Rails 3.1.3
Globalize3 latest
I am not sure if I can ask this question here in general Rails forum.
But I’ll try.
Currently I am using a gem, Globalize3, which is useful for model I18n.
Say, I have a model City, having only one column, name.
City names appear differently depending on the language, so perhaps this
particular gem is useful.
RailsCast is nice
My app has already many city names in ENGLISH and now I would like to
add city names in other languages as well. In order to do so, from my
understanding,
find a particular City entry
c = City.find(…)
c.name = “Tokyo”
then I need to change I18n.locale
I18n.locale = :ja
and add the new name in another language
c.name = “東京”
c.save
This is a tedious job. I want to add hundreds of city names from a CSV
file.
Can anyone give me tips for controllers for that?
I am stuck because I need to change I18n.locale on every insertion.