Goobalize3
Goobalize3 (Google + Globalize3) is useful to auto translate the attributes of your activerecord models.
If you have a model with some attributes translated with Globalize3 you can in easy way auto translate them via Google Translate.
With version 0.2.0 Goobalize use Bing to translate because Google Translate service is no more free.
Requirements
-
Globalize3
Installation
-
As gem: put
gem 'goobalize3'
in your Gemfile -
As plugin: run
rails plugin install [email protected]:pioz/goobalize3.git
Now create goobalize.yml
file in your rails config folder and put the follow line:
bing_app_id: YOUR_BING_APP_ID
google_api : YOUR_GOOGLE_TRANSLATE_API_KEY
You can get Google api key at Google apis console page.
Usage
You can auto translate all globalized attributes of an activerecord object with
@post.translate
this translate the attributes from current set locale (I18n.locale
) to all available locales (I18n.available_locales - I18n.locale
).
You can set also the target locales
@post.translate(:it, :en, :de)
The default service is Bing. To use Google Translate set:
GOOBALIZE_SERVICE = :google
Questions or problems?
If you have any issues with Goobalize3 please add an issue on GitHub or fork the project and send a pull request.
Copyright
Copyright © 2010 Enrico Pilotto.