Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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]
  • Loading branch information...
commit 887757ab825cf5c051bcead533118c672e9c61c7 1 parent d5a8b04
@jaredbeck jaredbeck authored carlosantoniodasilva committed
Showing with 6 additions and 0 deletions.
  1. +6 −0 guides/source/configuring.md
View
6 guides/source/configuring.md
@@ -242,8 +242,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
Please sign in to comment.
Something went wrong with that request. Please try again.