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...
1 parent d5a8b04 commit 887757ab825cf5c051bcead533118c672e9c61c7 @jaredbeck jaredbeck committed with carlosantoniodasilva Dec 5, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 guides/source/
6 guides/source/
@@ -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

0 comments on commit 887757a

Please sign in to comment.