未验证 提交 64385bdf 编写于 作者: R Rafael França 提交者: GitHub

Merge pull request #34241 from gmcgibbon/clarify_i18n_load_paths_gotcha

Clarify i18n load paths gotcha
......@@ -116,7 +116,7 @@ NOTE: The backend lazy-loads these translations when a translation is looked up
You can change the default locale as well as configure the translations load paths in `config/application.rb` as follows:
```ruby
config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
config.i18n.default_locale = :de
```
......@@ -135,6 +135,8 @@ I18n.available_locales = [:en, :pt]
I18n.default_locale = :pt
```
Note that appending directly to `I18n.load_paths` instead of to the application's configured i18n will _not_ override translations from external gems.
### Managing the Locale across Requests
The default locale is used for all translations unless `I18n.locale` is explicitly set.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册