Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The best approach in Rails 3 is using the built-in mechanism, <a href="https://github.com/svenfuchs/i18n" rel="nofollow">the I18n gem</a>. I am not sure if I understand you problem with the DB data. If you define the categories in the database, just add an i18n key to them and in the model return the translated title.</p> <p>e.g.</p> <pre><code>class Category # with a column that holds the i18n_lookup_key (maybe you think of a better name) ... def translated_title I18n.translate(i18n_lookup_key) end end </code></pre> <p>you then can use the translated_title method for displaying the category's title.</p> <p>If you have more questions about I18n in Rails, we just did a series on our blog:</p> <p><a href="http://hemju.com/2011/01/13/internationalization-i18n-api-in-rails-3-part-i/" rel="nofollow">Internationalization (I18n) API in Ruby on Rails 3 (Part I)</a></p> <ul> <li>Definition of Internationalization &amp; Localization</li> <li>How i18n mechanism works in Rails</li> <li>Setup/Configuration about the i18n mechanism</li> <li>Using the I18n with interpolation</li> <li>Using the I18n with pluralization</li> </ul> <p><a href="http://hemju.com/2011/01/20/internationalization-i18n-api-in-rails-3-part-ii/" rel="nofollow">Internationalization (I18n) API in Ruby on Rails 3 (Part II)</a></p> <ul> <li>Localization of Times/Dates</li> <li>Using views for translation</li> <li>Translating ActiveRecord errors</li> <li>Organization of resource files</li> <li>Setting the Locale from the Domain Name</li> <li>Setting the Locale from the URL Params</li> </ul> <p><a href="http://lingui.st/2011/09/internationalization-i18n-api-in-ruby-on-rails-3-part-iii/" rel="nofollow">Part 3 is coming out next week, with a PDF including all the topics.</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload