如何知道I18n轨道的优先级

时间:2015-10-01 06:58:58

标签: ruby-on-rails

我不知道config.i18n.load_pathI18n.load_path的区别。 https://stackoverflow.com/questions/32880561/config-i18n-load-path-and-i18n-load-path-difference

设计-I18N的视图

我使用https://github.com/mcasimir/devise-i18n-views

目录

enter image description here

我的项目有三个I18n用于用户属性。

  activerecord:
    attributes:
      user:

config/locales/models/*.ymlconfig/locales/devise*.ymlgems/devise-i18n-views-0.3.5/locales/*.yml

运行

我认为优先考虑。

  1. config / locales / models / *。yml
  2. 配置/区域设置/设计* .yml
  3. 宝石/设计-I18N的视图-0.3.5 /语言环境/ *。YML
  4. 如何知道优先级

    http://guides.rubyonrails.org/i18n.html没有说I18n的优先级。

1 个答案:

答案 0 :(得分:0)

我不确定知道优先权会对你有所帮助。

问题是,当您在开发模式下更改某些语言环境文件时,当您的服务器仍在运行时,将重新加载已更改的文件,并将覆盖现有的activerecord.attributes.user范围。

所以我认为最可靠的方法是将activerecord范围提取到activerecord.yml文件。