2

any hint on how to create a keyboard shortcut to translate a selected text in Safari (or, even better, in any app?)

3
  • Needs a proper answer, but I use Popclip with Translatium. Not keyboard shortcut, but select text and click on the pop up button
    – Gilby
    Commented Sep 8, 2022 at 7:03
  • 1
    When I select text in Safari (and other apps) and right-click with the mouse a menu pops up and offers to translate the selected text for me ... and you can use the accessibility feature 'Enable Mouse Keys' to, well, use the keyboard to control the mouse (Ctrl+5-on-the-digit-keypad implements a right-click). Have I entirely missed the point of the question? Commented Sep 8, 2022 at 8:41
  • Gilby's solution - although requiring a paid app -seems really interesting, as I can work mouse-less. I've liked also that on Translatium I can save my searches to recall later. I'll try to work out something with an Automation service. Thanks for your inputs!
    – Mart R
    Commented Sep 8, 2022 at 11:56

4 Answers 4

3

Yes this is possible with the Shortcuts app. It will work in Safari or any app that lets you select text. You can bind it to any keyboard shortcut. You can even use it on iPhones and iPads.

You can try the one I use here

It's very easy to set one up and customize it, say if you want to change the translation language:

Customizing the translation shortcut

Here's how I use it everyday.

1
  • best answer on the internet
    – angry kiwi
    Commented Aug 28 at 5:06
1

On Ventura (and certainly several preceding OS versions), I have an option to Translate text in the contextual menu of any text I right-click on:

enter image description here

I'm fairly sure it's not a third-party add-on -- if it were, it would be lower down the menu, surely.

0

I found a Safari extension that translates selected text.

This extension is made by uetchy and is named Polyglot. You can find instructions on GitHub or simply download Polyglot from App Store.

Setup:

  1. Install Polyglot.app from the Mac App Store
  2. Open the Polyglot.app in Applications
  3. Configure Settings in Polyglot.app
  4. Open Safari > Settings > Extensions
  5. Activate Polyglot Extension
  6. Extension is now available Note: any pages that were already open before the extension was activated may need to be reloaded for the extension to work on them.
0

Here is what I did for the most simple possible shortcut. Let's you highlight some text anywhere in macOS, run this Shortcut (I do it from the Services menu or add a keyboard shortcut to it), and it will open a pop-up Safari window with your text in Google Translate.

enter image description here

  1. Receive [Text] input from [Quick Actions]
  2. URL [Encode] [Shortcut Input]
  3. https://translate.google.com/?sl=auto&tl=en&text=**URL Encoded Text**
  4. Show webpage at URL

Make sure in step 3, the URL Encoded Text variable is part of the URL, i.e. let no space exist between them. Add the [URL ENCODED TEXT] variable right into the URL itself, not as an additional variable via the "+" sign.

And make sure "Services" is checked under the "Quick Actions" sidebar preferences.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .