Have you checked out the localization plugin?
Here's the link to the plugin readme:
http://dev.rubyonrails.org
Features
* Any number of languages or locales
* Simple method to defines singluar/plural translations
* Can use lambdas to provide Ruby-code based dynamic translations
* Customizable for different instances of the application
In short, you put your translations in separate files per language and then use <%_ 'yes' %> (with an underscore) which will give you "yes", "ja", or "oui" depending on the language set.
Main Topics
Browse All Topics





by: adrpoPosted on 2008-03-15 at 22:14:16ID: 21135664
Why not the same db? Have a table called translation:
id | language_1 | language_2 | language_3 | language_4 ....
--------------------------
1 | English | Spanish | .....
....
Then everyhere where you need a translated string you put an
id foreign_key in translation(id).
You can then make a stored procedure: getString(id, language).
See more here (PostgreSQL, but is similar in MySQL):
http://www.ida.liu.se/~adr
Search for global.translate and global.out_t.
Cheers,
za-k/