On a Mac, you can assign a keyboard shortcut to the built-in Translate service in System Settings. That works in apps that expose the service. For a shortcut that behaves consistently across apps, Screen Translate can copy the current selection, translate it on-device and restore the clipboard.
Set a shortcut for the macOS Translate service
Some of this is built in and worth knowing before you install anything. In Safari and most native text views, selecting text and right-clicking offers Translate, and Services in the app menu can be given a shortcut in System Settings > Keyboard > Keyboard Shortcuts > Services. Where it works, it works - but it depends on the app implementing the menu, so it is missing in a great many of them, and a right-click is not a keyboard shortcut.
Use one translation shortcut across Mac apps
Screen Translate adds a Translate Selection shortcut that works the same way everywhere: select the text as you normally would, press Option-Shift-S, and the translation opens beside the original. You never leave the app you were reading in, and the shortcut is rebindable in Settings if those keys are taken.
Reading a selection out of another app means copying it, which macOS only permits with Accessibility access - so the app asks for that permission on first launch, and it is the reason the app is distributed directly rather than through the Mac App Store. Your clipboard is put back exactly as it was straight afterwards: every item and every format, not just the plain text.
Translation itself runs on-device, so the selection never leaves the Mac. If the text is not selectable in the first place - a scan, a video, an interface - the other shortcut captures a region of the screen and reads it with OCR instead.

Free, open source, and downloadable from GitHub.
FAQ
How do I translate selected text on a Mac with a keyboard shortcut?
Assign one to the Translate service in System Settings > Keyboard > Keyboard Shortcuts > Services, which works in apps that offer it. For a shortcut that behaves the same in every app, Screen Translate maps Option-Shift-S to Translate Selection.
Why does it need Accessibility access?
There is no API that asks another app for its selection, so the text is copied on your behalf - and macOS only allows that with Accessibility access. It is used for nothing else.
Does it overwrite my clipboard?
Only for a fraction of a second. What was on the clipboard is saved first and restored immediately afterwards, with every item and every format intact.
Can I change the shortcut?
Yes. Both shortcuts are rebindable in Settings, and either can be switched off entirely while the menu bar actions keep working.