How do I translate a list of English words into another language using an online translation service with Mathematica?

Since the Google Translate API requires authentication, a simple work around is to deploy as a web app a Google Apps Script that uses Google's LanguageApp, and then call that using URLExecute[].

To setup the Apps Script, go to script.google.com and create a new script with the following doGet function that uses the LanguageApp.translate method:

function doGet(e) {
  textlist=e.parameters.textlist;
  language=e.parameters.language[0];

  translation=[];
  for (nn in textlist){
    translation.push(LanguageApp.translate(textlist[nn], 'en',language));
   }
  outstring=JSON.stringify(translation)
  return ContentService.createTextOutput(outstring)
}

Save your script and then under the Publish menu, select Deploy as web app. Set the Who has access to the app to anyone, even anonymous to bypass login requirements. When you deploy, you will get a URL that looks like "https://script.google.com/macros/s/alphaNumericSequence/exec" with some alphaNumericSequence.

Now you can use URLExecute in Mathematica as follows:

webAppURL="https://script.google.com/macros/s/alphaNumericSequence/exec"
onlineTran[textList_, languageCode_] := 
  URLExecute[webAppURL, {"textlist" -> textList, "language" -> languageCode}]

Executing: onlineTran[{"Takaaki Kajita", "Arthur B. McDonald", "Isamu Akasaki", "Hiroshi Amano", "Shuji Nakamura"}, "zh-CN"]

Returns: {"隆明朱音","阿瑟·麦克唐纳","赤崎勇","天野浩","中村修二"}

The list of languageCodes supported by Google's LanguageApp can be found here

PS - In the event you need to edit the Google Apps Script, you will need to redeploy as a new version, because deployed scripts are static (see version documentation here). To deploy a new version of a script, save your changes and then go back to Deploy as web app under the Publish pulldown menu. Then select, the new option under Project version. Note that the deployed URL does not usually change, so you don't have to edit your Mathematica code. (This comes in handy when debugging Apps Script, especially when I make lots of typos -- sorry about that.)


ClearAll[YandexTranslate];
YandexTranslate[string_String, lang_String, apikey_String: apikey] :=
 StringCases[
   URLFetch[
    "https://translate.yandex.net/api/v1.5/tr.json/translate?key=" <> 
     apikey <> "&text=" <> string <> "&lang=" <> lang <> 
     "&format=plain"
    ],
   "[\"" ~~ x___ ~~ "\"]}" :> x
   ][[1]]

YandexTranslate["Hello World!", "en-zh"]

"你好世界!"

You can receive your API key here: https://tech.yandex.com/translate/

The daily request limit is 1,000,000 characters. The monthly limit is 10,000,000 characters. To increase the request limit, switch to the fee-based version of the service.

It should be noted that Yandex can not transliterate your names. Google can do it but Google Translate API has no free quota.