Rails 3 force localization language for specific text
Any way to force the translation to a specific lang开发者_如何学Pythonuage only for some text. Something like:
t("my.text",:fr)
The reason is that i want the user to be able to change the language of their content but not the site interface. Thanks!
It could be done this way:
I18n.t :foo, :locale => :fr
equivalent too:
t("my.text", :locale => :fr)
t("my.text", locale: :fr)
More options here
精彩评论