开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜