You should have a look at the Rails Internationalization Guide,
especially the part about localizing Active Model attributes.
http://guides.rubyonrails.org/i18n.html#translations-for-active-record-models

Simply set the local for the I18n API:
I18n.locale = :de

and translate all the active model attributes:

en:
  activerecord:
    models:
      user: Dude
    attributes:
      user:
        login: "Handle"
      # will translate User attribute "login" as "Handle"

Hope that helps!

On Nov 7, 2:55 pm, Rodrigo Ruiz <rodrigo.ru...@gmail.com> wrote:
> Hi, I have to set those language flags on my website, and depending on
> which one was selected it should show the pages in specific languages.
> Problem is that this translation is also needed for the model attributes.
>
> How should I do that?
>
> Just save many attributes (one for each language) for each attribute I
> currently have and then set a lot of if's in my html?
>
> Thank you,
> Rodrigo

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to