Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3788100
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:56:42+00:00 2026-05-19T11:56:42+00:00

I am new to Rails and I need to implement internationalization in an application.

  • 0

I am new to Rails and I need to implement internationalization in an application.
Till now I looked through r18n-rails, globalize3 and gettext_i18n_rails.

I have to internationalize the templates text along with some DB data (some categories as an example).

I like the way gettext_i18n_rails works with templates text but it doesn’t provide any solution for DB data (or does it?). From other side r18n-rails and globalize3 seem to do the job for DB data but not for templates. At first I thought to combine them (globalize or r18n + gettext_i18n_rails) but this could nod be a good idea, especially if this is gonna be a big project.

So my question is:

What is the best I18n approach for Rails 3 considering templates text + DB text + project size?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T11:56:42+00:00Added an answer on May 19, 2026 at 11:56 am

    The best approach in Rails 3 is using the built-in mechanism, the I18n gem.
    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.

    e.g.

    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
    

    you then can use the translated_title method for displaying the category’s title.

    If you have more questions about I18n in Rails, we just did a series on our blog:

    Internationalization (I18n) API in Ruby on Rails 3 (Part I)

    • Definition of Internationalization & Localization
    • How i18n mechanism works in Rails
    • Setup/Configuration about the i18n mechanism
    • Using the I18n with interpolation
    • Using the I18n with pluralization

    Internationalization (I18n) API in Ruby on Rails 3 (Part II)

    • Localization of Times/Dates
    • Using views for translation
    • Translating ActiveRecord errors
    • Organization of resource files
    • Setting the Locale from the Domain Name
    • Setting the Locale from the URL Params

    Part 3 is coming out next week, with a PDF including all the topics.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Rails. I have my rails application and now I want
I am new to Rails, so bear with me, I need to have apache
I am starting a new Rails project and I need to implement a login
I need to implement a custom error page in my rails application that allows
My requirement is to implement auto complete feature in my rails application. I need
I'm new to rails and need some help with iterating through a sql result.
Hi I'm very new to rails and need some help on iterating through nested
I'm new to Rails and I know a bit of Jquery. I need a
Starting a new rails project and we have a well-thought-out color palette, and want
I'm developing a new rails application which is supposed to be installed several times

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.