开发者

Rails 3 force localization language for specific text

开发者 https://www.devze.com 2023-03-19 15:35 出处:网络
Any way to force the translation to a specific lang开发者_如何学Pythonuage only for some text. Something like:

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

精彩评论

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

关注公众号