Reputation: 1322
I can see translations for the default language using the Rails console using this code:
I18n.t('views.signup.company_info')
But how can I see translations for the german language?
Upvotes: 0
Views: 393
Reputation: 476
I18n.with_locale(:de) {I18n.t('views.signup.company_info')}
If you want to use a specific language for translation in a code block you can do this:
I18n.with_locale(locale) do
your_code
end
Upvotes: 1
Reputation: 1322
For displaying the translation for the specific language we need to set the locale:
I18n.t('views.signup.company_info', locale: :de)
Upvotes: 2