I’ve been reading all the tutorials and blog entries I can find on this
subject but one idea I haven’t seen floated yet is to do multilingual
rails using what Rails is reallly quite good at database interaction.
I’ve seen Sacha’s gettext/po/mo idea
(Peak Obsession) and also an idea using
.rb files by Per Wigren
(http://www.tuxsoft.se/sv/oss/rails/multilingual) .
Has anybody thought about trying to do it like Vbulletin: the code for
putting the right languages on the page, according to user preference,
is part of the application but the actual translation and languages are
all done through the database, which makes it very easy for the
administrator and translator to do their work. It would mean that to
translate your app, you would just need to give the translator access to
you translation tables interface and let him get on with it, saving
directly into the database. More control, less hassle.
In the database, there are language, phrase and even phrasegroup tables
and then in the application they declare a global $vbphrase variable
which is specified as
$vbphrase['‘here_goes_your_translated_phrase_reference_string’] in each
place where it is necessary to output text. The user chooses one of the
available languages and this is recorded in his user profile in the DB
and thus remembered and can be changed whenever they want. People who
are not registered can also change the language through a drop down on
each page. They have it set up not just for the actual phrases, but also
left to right issues, time and dates, even seperators for decimals and
thousands. All the changeable stuff is stored in a database and the code
interprets that.
So, my 0.02â?¬ to the I18N ideas. If anybody likes the idea, I can dig out
all the flows and code references from Vbullletin and we could see how
we might apply it for rails.