diff options
author | Jared Beck <jared@jaredbeck.com> | 2013-12-05 12:25:57 -0500 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-12-19 08:14:51 -0200 |
commit | 813ab76788206ded84cb25e6cd3c259a399ba565 (patch) | |
tree | 42370fd681e1fddc16a7019a11bcbfd0ebdee15e /guides | |
parent | 5b0fc1a007522e9d41faf364f74426be2b9e3f63 (diff) | |
download | rails-813ab76788206ded84cb25e6cd3c259a399ba565.tar.gz rails-813ab76788206ded84cb25e6cd3c259a399ba565.tar.bz2 rails-813ab76788206ded84cb25e6cd3c259a399ba565.zip |
Update configuring guide with I18n options regarding available locales
Add information about 'available_locales' and 'enforce_available_locales'
to the configuring guide.
Closes #13202. [ci skip]
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/configuring.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 59c2594422..aeeea94c1e 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -244,8 +244,14 @@ config.middleware.delete "Rack::MethodOverride" ### Configuring i18n +All these configuration options are delegated to the `I18n` library. + +* `config.i18n.available_locales` whitelists the available locales for the app. Defaults to all locale keys found in locale files, usually only `:en` on a new application. + * `config.i18n.default_locale` sets the default locale of an application used for i18n. Defaults to `:en`. +* `config.i18n.enforce_available_locales` ensures that all locales passed through i18n must be declared in the `available_locales` list, raising an `I18n::InvalidLocale` exception when setting an unavailable locale. Defaults to `true`. It is recommended not to disable this option unless strongly required, since this works as a security measure against setting any invalid locale from user input. + * `config.i18n.load_path` sets the path Rails uses to look for locale files. Defaults to `config/locales/*.{yml,rb}`. ### Configuring Active Record |