ANN: Babel 0.1.1 Released

Babel 0.1.1 has just been released. Babel is a tiny library for
translating between languages using Google’s automatic language
translation. More information about Google’s automatic translation can
be found here:

http://www.google.com/intl/en/help/faq_translation.html

=== Installation

sudo gem install babel

=== Usage

Babel.translate(“hello”, :en, :fr) #=> “Bonjour”

You can also translate a text into multiple languages by supplying
multiple destination languages:

Babel.translate(“hello”, :en, :fr, :it) #=> [“Bonjour”, “Ciao”]

There’s also a shorthand version using String#translate:

“your socks are sexy”.translate(:en, :de) #=> “Ihre Socken sind
sexy”

=== Supported languages

For a list of supported languages please visit the Google translation
FAQ:

http://www.google.com/intl/en/help/faq_translation.html#langpairs

=== More info

Babel RDOC:

http://babel.rubyforge.org/

Babel source code:

http://babel.rubyforge.org/svn/trunk/

Thanks for writing that gem. However installing it via gem install babel
doesn’t work properly. It installs a babel gem"babel (0.1.4)" (as listed
by gem list), which has no translate method, but a lot of random stuff.
Maybe a name conflict?

Regards
Stefan

Installing via download + local install works nice btw. And thanks
again, made a butler plugin in 4 lines to translate phrases :slight_smile:

Regards
Stefan

On Jan 13, 11:58 pm, Stefan R. [email protected] wrote:

Thanks for writing that gem. However installing it via gem install babel
doesn’t work properly. It installs a babel gem"babel (0.1.4)" (as listed
by gem list), which has no translate method, but a lot of random stuff.
Maybe a name conflict?

Yes, there’s a name conflict with an existing gem. I’ve renamed mine,
so you now you’ll need to do:

sudo gem install rbabel

And also:

require ‘rbabel’
“hello”.translate(:en, :fr)

Also new is a command line tool for translation:

cat english.txt | rbabel en:fr > french.txt

The docs are updated:

http://babel.rubyforge.org/