Ruby Forum Rails I18n > internationalization options

Posted by Chuck R. (chuckr)
on 02.11.2007 21:20
Hi,

I'm new to ruby and rails. I need support for for localized pages, pages
with multilingual content, international date/time formats, and calendar
and time zone calculations.

Initially, I asked someone on the ICU project
<http://www.icu-project.org/> and they directed me to ICU4R
<http://icu4r.rubyforge.org/>. I thought that this was my solution until
I scrolled down and found this comment:
  "The code is slow and inefficient yet, is still highly experimental,
so can have many security and memory leaks, bugs, inconsistent
documentation, incomplete test suite. Use it at your own risk."

Next, I found this link:
http://wiki.rubyonrails.org/rails/pages/InternationalizationComparison

Globalize <http://www.globalize-rails.org/globalize/> looks very
up-to-date and well supported. And every time I ask people about
internationalization options, they seem to either mention Globalize or
say that they don't know.

Is Globalize the most widely used option? Do people on this list
recommend Globalize or other options?

thanks,
Chuck
Posted by Samuel Lown (samlown)
on 05.11.2007 10:21
Hi Chuck,

Chuck R. wrote:
> 
> Is Globalize the most widely used option? Do people on this list
> recommend Globalize or other options?
> 

Globalize is probably is one of the most widely used solutions for 
internationalisation in Rails, given, as you say, it is well looked 
after and provides a very easy solution to integrate with your Rails 
project.

However, I suspect most people are slightly suspicious about the way 
translations are handled, everything in Globalize is stored in three 
tables, including one master table that contains all of your 
translations in every language. If your into wanting to make DB access 
as minimal and efficient as possible, like me, then this may or may not 
ring bells. Personally, I now use Gettext for all of my web application 
texts, as its very mature and while initially it takes a bit of 
understanding, it offers the most complete solutions for handling 
strings. Having said that, I did use Globalize in one major project and 
it works great!

One thing you should bare in mind, is the distinction between 
translating the application (the text in the views) and the data models. 
Globalize will throw these together in the same basket, but I'm not 
convinced this is an ideal solution. Checkout my plugin 
'translate_columns' for a description of the problems and a solution 
that I came up with:

http://samlown.com/page/RailsTranslateColumnsPluginReadme

This only handles models, so you'd need to find another solution, such 
as globalize or gettext, for your views.

I18n is quite complex, and requires a bit of thought to implement well, 
but stick with it, its worth the effort!

Cheers, Sam