Internationalization/Localization of Rails (update)

For quite a while, a bunch of great developers frustrated by the lack
of internationalization solutions for Rails started writing their own
plugins http://wiki.rubyonrails.org/rails/pages/InternationalizationComparison

The major problem for us was the fact that we always had to monkey
patch Rails so people could use Rails helpers / ActiveRecord in
another languages than English.

Most of us got frustrated and decided to work together in order to
find a compromise and define an internationalization standard for
Rails. Based on our different approaches and background we spent hours
crafting a solution that will hopefully provide Rails with more
flexibility.

Looking at Globalize, Simple Localization, Ruby-GetText-Package or
GlobaLite, you will notice a totally different approach. It has been
really hard for us to agree on all the details but we did it!

Here is a quick preview of what we are planning to do.

2 objectives:

  * eliminate the need for monkey patching Rails in order to
internationalize an application.

  * a common api that can be leveraged by all l10n plugins.

In order to do that, we agreed to keep things as simple as possible so
each of us can developer his/her own solution, however since we want
to have a common base to work from we decided to:

- develop an internationalization library (i18n) that will handle all
the usual i18n tasks such as adding a localization method,
interpolation and basic pluralization. The i18n library will have
built-in graceful degradation support using a default language
provided by the library author. (used if no localization library is
loaded)

- patch Rails libraries to use the i18n library. (with English as
fallback language)

- develop a Localization library (l10n) that will handle locales,
advanced pluralization rules, advanced interpolation and localization
of objects (string, date/time, currency..). The l10n lib will use yaml
files to lookup string localizations and use a ruby file defining
language rules.

I don't want to get into the implementation details since we are
working on an official document. But we believe that by approaching
the challenge this way, we will offer a very flexible solution that
can be used by other libraries (Merb, Sinatra, DataMapper...) and at
the same time can be extended by any plugin/gem developers without
having to reinvent the wheel.

Expect more details in the next few weeks.

-Matt

Do you guys have a blog/wiki/etc. with information covering what you
have so far? Something with more detail than the bullet points below?
If not, I'll wait the few weeks. :slight_smile:

Hey Andrew,

We do have a wiki & google group but they are private for now. We hope to make an official announcement sometimes next week or the week after. However any Rails modifications would have to be accepted by the Rails core team.

-Matt

I have developed an high level extension for Globalize, for inplace
translations of views, via ajax.

You can find a guide, tips, video tutorials and more, at the related
page: http://www.lucaguidi.com/pages/click-to-globalize

I hope this is useful for your purposes.

Luca.

Hi Luca,

This will certainly be usefull.

We are on the verge of a massive rewrite of Globalize inline with the
new api and which will allow people to pick and choose between
different gems to get selected functionality. The idea is to pick out
the best features/code from all i18n projects and provide a one-stop
place for rails/ruby i18n/L10n resources.

So all help is appreciated....

Many thanks.

Saimon