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:
commit
64385bdf30
1 changed files with 3 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue