Trying to do simple model I18n, not succeeding


#1

Basically, all my tables look like this:

create_table “countries”, :force => true do |t|
t.string “name_en”
t.string “name_ja”
end

If the locale is set to ‘en’, I want Country.name to return
Country.name_en. Is there a way to do this?

Rich


#2

Rich Pav a écrit :

Basically, all my tables look like this:

create_table “countries”, :force => true do |t|
t.string “name_en”
t.string “name_ja”
end

If the locale is set to ‘en’, I want Country.name to return
Country.name_en. Is there a way to do this?

You are looking for the great translatable_columns plugin by Iain :
http://github.com/iain/translatable_columns/tree/master