Google Translate CLI: Translating at the command line


© Lead Image © Cienpies Design,

© Lead Image © Cienpies Design,

Article from Issue 165/2014

If you regularly work in a terminal and need to translate sections of text, you can run the Google Translate CLI tool to avoid annoying changes to the browser window.

When working with Linux, you may often come across text in foreign languages, such as instructional pages or output from various tools, created by someone who works in a language other than your native language. In these cases, you usually resort to looking up individual terms and phrases on translation sites  – together with time-consuming paging back and forth between the console and web browser. In such cases as these, Google Translate CLI comes to the rescue: With just one call, it conveniently translates single words or whole blocks of text directly at the command line.


The best-known tool for straightforward translation of terms and texts is Google Translate: You type the source text in the left-hand box, and the box on the right shows you the real-time translation in the target language [1]. Although the browser version of the translation project is available for free, Google also offers a commercial API that you can embed in your own applications. Besides the financial aspect, however, the API has another disadvantage: Each user requires a separate API key, which makes this version almost totally uninteresting for free translation tools.

Google Translate CLI [2] therefore deliberately takes the roundabout route of accessing the Google Translate website directly by means of a script. Thus, you do not need to have your own API key, yet you still receive a response in a brief and precise form  – much as you would through an API.


Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95


njobs Europe
Njobs Netherlands Njobs Deutschland Njobs United Kingdom Njobs Italia Njobs France Njobs Espana Njobs Poland
Njobs Austria Njobs Denmark Njobs Belgium Njobs Czech Republic Njobs Mexico Njobs India Njobs Colombia