Class | I18n::Config |
In: |
lib/i18n/config.rb
|
Parent: | Object |
Returns an array of locales for which translations are available. Unless you explicitely set these through I18n.available_locales= the call will be delegated to the backend.
Defaults to nil so that it triggers the deprecation warning
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'
The only configuration value that is not global and scoped to thread is :locale. It defaults to the default_locale.
Returns the current handler for situations when interpolation argument is missing. MissingInterpolationArgument will be raised by default.
Sets the missing interpolation argument handler. It can be any object that responds to call. The arguments that will be passed to call are the same as for MissingInterpolationArgument initializer. Use +Proc.new+ if you don‘t care about arity.
You can supress raising an exception and return string instead:
I18n.config.missing_interpolation_argument_handler = Proc.new do |key| "#{key} is missing" end