加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 如果在特定区域设置中缺少翻译,如何配置i18n以

发布时间:2020-12-16 21:08:27 所属栏目:百科 来源:网络整理
导读:如果在特定区域设置中缺少翻译,如何配置i18n以使用en locale翻译? 当前插入了翻译缺失的消息. 我正在使用RoR 3.1. 解决方法 发现类似 question 这是答案: # application.rb# rails will fallback to config.i18n.default_locale translationconfig.i18n.fa
如果在特定区域设置中缺少翻译,如何配置i18n以使用en locale翻译?

当前插入了翻译缺失的消息.

我正在使用RoR 3.1.

解决方法

发现类似 question

这是答案:

# application.rb

# rails will fallback to config.i18n.default_locale translation
config.i18n.fallbacks = true

# rails will fallback to en,no matter what is set as config.i18n.default_locale
config.i18n.fallbacks = [:en]

# fallbacks value can also be a hash - a map of fallbacks if you will
# missing translations of es and fr languages will fallback to english
# missing translations in german will fallback to french ('de' => 'fr')
config.i18n.fallbacks = {'es' => 'en','fr' => 'en','de' => 'fr'}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读