I am looking for some tips and tricks for best practices for using internationalization. I searched around, but I'm not very happy with what I read. Most of the articles I read focus on using yml files for I18n that won't work in my situation.
Currently, I have several database tables with English text. Some of these tables contain text fields with a length of several sentences, and some contain 6 + paragraphs of text. I would also like to have these fields in Spanish.
The approach that I am currently considering is to use the I18n-active shortcut and have 1 translation table that the application will use for all translations in the application
class CreateTranslations < ActiveRecord::Migration def self.up create_table :translations do |t| t.string :locale t.string :key t.text :value t.text :interpolations t.boolean :is_proc, :default => false t.timestamps end end def self.down drop_table :translations end end
Is this the best way to continue?
On the one hand, all translations will be well kept in one table. On the other hand, every time a user requests a database for I18n content. The application will query the source table for the key, and then query the translation table. Another problem is that the translation table will be massive and has a huge number of lines, since it will store all the translations for the application (everything from the section heading [a few words] to entire pages of text.
Any information is appreciated. Thanks
source share