Search code examples
ruby-on-railsactiverecordruby-on-rails-3.2rails-i18n

Is there a way to internationalize/localize model values?


Our users put documents into the database and provide e.g. names in different languages.

We store those in different DB fields, say name_en, name_fr, name_de and so on.

My question is:

Does Rails have a mechanism (probably provided by i18n) that selects the right name based on the current language setting?

I imagine a call like:

<%= t(document, :name) %>


Solution

  • This gem may help https://github.com/globalize/globalize

    I hope you will find this information useful.