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:
First of all, get the source code:
git clone git://github.com/dookie/google-translate-api.git
t 'Olá mundo!' de
Checking the GEMS
sudo gem install whatlanguage json htmlentities
- Make this lib a Ruby on Rails plugin
You can contribute to this approach, just keep the Licence.