text 24 Jan

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.

Installation

As gem: put gem 'goobalize3' in your Gemfile
As plugin: run rails plugin install git@github.com:pioz/goobalize3.git

Requirements

  • Globalize3

Usage

First of all, you need to create google_translate.yml configuration file in your config folder. Put

api : YOUR_GOOGLE_TRANSLATE_API_KEY

You can get api key at this link: https://code.google.com/apis/console/

Now, 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)

blog comments powered by Disqus