Search code examples
ruby-on-rails-3internationalizationrails-i18n

How to display two different translation in one view - Rails ?


I have an app with two translation: :pl and :en. I want to send email in both languages (one view file)

Something like that:

=t(".my_translation_key", :en)
=t(".my_translation_key", :pl)

instead of

-I18n.locale = :en
=t(".my_translation_key")

-I18n.locale = :pl
=t(".my_translation_key")

is there any way ?


Solution

  • Just send the :locale option:

    = t(".my_translation_key", :locale => :en)
    = t(".my_translation_key", :locale => :pl)