Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3 force localization language for specific text

Any way to force the translation to a specific language 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!

like image 518
montrealmike Avatar asked Jul 12 '11 22:07

montrealmike


1 Answers

It could be done this way:

I18n.t :foo, :locale => :fr

equivalent too:

t("my.text", :locale => :fr)
like image 69
apneadiving Avatar answered Oct 17 '22 16:10

apneadiving