1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #34241 from gmcgibbon/clarify_i18n_load_paths_gotcha

Clarify i18n load paths gotcha
This commit is contained in:
Rafael França 2018-10-22 13:38:29 -04:00 committed by GitHub
commit 64385bdf30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.