Created: 2008-10-26 20:59
Updated: 2015-11-05 01:02


Google Translator API


This is an example of an API for Google Translate, created by me (dookie) for personal use. The aim of this implementation is create a simple command-line to quickly translate anything. It's very helpful for us, programmers, when reading some articles, books, or posts in different languages and we need to translate some word or expression.

How I use it

I created a alias for my script, like that, in my .bash_profile (I'm using a Mac OS X):

alias t='ruby /Users/dookie/Projects/Experiencies/Ruby/translate/bin/translate.rb'

And, to execute the translation:

t [word or expression] [translate language]

t 'Olá Mundo!' en

Then, the result will be:

Hello world!


First of all, get the source code:

git clone git://

Then run:

ruby bin/install.rb

And enjoy:

t 'Olá mundo!' de


Checking the GEMS

  • whatlanguage
  • json
  • htmlentities


sudo gem install whatlanguage json htmlentities


  • Make this lib a Ruby on Rails plugin


You can contribute to this approach, just keep the Licence.

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more