class I18n::Config
- I18n::Config
- Reference
- Object
Defined in:
i18n/config.crInstance Method Summary
-
#available_locales : Array(String)
Returns the available locales
-
#backend
Returns the current backend.
-
#backend=(backend : I18n::Backend::Base | Nil)
Sets the current backend.
-
#default_locale
Returns the current default locale.
- #default_locale=(new_default : String)
-
#default_separator
Returns the current default scope separator.
-
#default_separator=(separator : Char | Nil)
Sets the current default scope separator.
-
#exception_handler
Returns the current exception handler.
-
#exception_handler=(exception_handler : Nil | I18n::ExceptionHandler)
Sets the exception handler.
-
#load_path
Allow clients to register paths providing translation data sources.
-
#load_path=(load_path : Nil | Array(String))
Sets the load path instance.
-
#locale
The only configuration value that is not global and scoped to thread is :locale.
-
#locale=(locale : Nil | String)
Sets the current locale pseudo-globally, i.e.
Instance Method Detail
Sets the current backend. Used to set a custom backend.
Returns the current exception handler. Defaults to an instance of I18n::ExceptionHandler.
Sets the exception handler.
Allow clients to register paths providing translation data sources. The backend defines acceptable sources.
E.g. the provided SimpleBackend accepts a list of paths to translation files which are either named *.rb and contain plain Ruby Hashes or are named *.yml and contain YAML data. So for the SimpleBackend clients may register translation files like this: I18n.load_path << 'path/to/locale/en.yml'
Sets the load path instance. Custom implementations are expected to behave like a Ruby Array.
The only configuration value that is not global and scoped to thread is :locale. It defaults to the default_locale.
Sets the current locale pseudo-globally, i.e. in the Thread.current hash.