Use Naver Papago translation system-wide on macOS

Here is a convenient way to get real Naver Papago translations for anything in your macOS computer. From any app, including Safari, Finder, Pages, Chrome, Mail, basically anywhere you can highlight text in macOS, you can get an immediate pop-up of Papago translation with a quick keyboard shortcut, no 3rd party apps needed.



Update Nov 2022:

This method uses the Automator app, which still works fine. But if you'd prefer to use the Shortcuts app, here's a newer updated post describing that:


Original post continues below


Background

I've been playing around a lot lately with a MacBook and quickly realized the severe limitations of Safari with regards to extensions. I was spoiled by Chrome and the power of its extensions store. And of course, living in Korea, I value Chrome's built-in translation features for whole-page translation, and its translate extensions to translate highlighted words/text. Apple claims to offer a translator now but I've never seen a real Korean site it works on. 

So I was looking for a way to bridge the gap and give me convenient quick translations, ideally anywhere in macOS. I tried a few 3rd party apps but found them all lacking. 

Then I found that many people were making use of macOS "Services" to have semi-built-in Google Translation across the OS. I realized it would be easy to alter the URL in their code to utilize Naver's Papago translations instead of Google. And easy it was. 

As a result, I can now highlight text pretty much anywhere in any app on macOS and with a simple keyboard shortcut get an immediate pop-up window translating it, as seen in the example above. 

Here is how you can do it. 

Create a Service in Automator to provide system-wide Papago translation pop-up

We will use a built-in feature of macOS called "Services" which are little utilities you can easily run from any app menu (and usually from right-clicking too). This part should be done manually but it's very easy.

Step 1: Create a new Automator service

Launch "Automator" (the app is already on your Mac) and the screen below will appear. Choose "Quick Action."


Step 2: Input the service

This will be done in just a few parts.

  1. In the search box on the left, type "Run Javascript" and double-click the result to add a Javascript box to the right-hand workflow. 
  2. Type "Website Popup" in the same search box and double click that to add it to the workflow too.
  3. Ensure the menus above the workflow read: Workflow receives current [text] in [any application].
  4. Paste the following code into the Run JavaScript box:

function run(input) {
var output = "https://papago.naver.com/?sl=ko&tk=en&st=" + encodeURIComponent(input)

return output;
}

It should look like this:


Now give this project a name (like "Papago") and save. That should be it. 

Step 3: Test it


You can test this now by highlighting some Korean text and going to the app's menu (for example, in Chrome, go to the "Chrome" menu next to the Apple menu) and choose "Services" -> "Papago". 

If it all worked, a system pop-up should appear looking like below. Notice I highlighted some Korean text, then chose "Papago" from the Services menu. It opened a pop-up Papago webpage pre-filled with my highlighted text. 


Step 4: Create keyboard shortcut

You definitely do not want to have to go fishing through the Services menu each time you need a translation. So:

  1. Go to Settings -> Keyboard -> Services
  2. Find your Service name (for example, "Papago")
  3. Assign a keyboard shortcut to it. I chose Ctrl-P
  4. Enjoy.


I find this a very convenient way to get quick word or phrase translations anywhere in macOS. 

Obviously I still prefer actual Chrome which handles 99% of any translations I need. Or if I want Papago page translation, Whale browser which still works great and which I've slowly started adopting more and more. It's great cross-platform. But it's nice to have this ability anyway.

You can of course also assign a Service in the same way for getting Google Translations too. 

In fact you can use Services with the same basic outline as above for any web-based search. One that I've been using more of lately is "Coupang searcher" where I can highlight the name of a product, hit a keyboard shortcut, and it will open the Coupang results page for it. [Same as above, just swap out the URL for https://www.coupang.com/np/search?component=&q= ]

Hope you find it useful.


Comments