Methods
A
B
D
E
L
Instance Public methods
available_locales()

Returns an array of locales for which translations are available. Unless you explicitely set the these through I18n.available_locales= the call will be delegated to the backend and memoized on the I18n module.

# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/config.rb, line 37
def available_locales
  @@available_locales ||= backend.available_locales
end
available_locales=(locales)

Sets the available locales.

# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/config.rb, line 42
def available_locales=(locales)
  @@available_locales = locales
end
backend()

Returns the current backend. Defaults to +Backend::Simple+.

# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/config.rb, line 15
def backend
  @@backend ||= Backend::Simple.new
end
backend=(backend)

Sets the current backend. Used to set a custom backend.

# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/config.rb, line 20
def backend=(backend)
  @@backend = backend
end
default_locale()

Returns the current default locale. Defaults to :'en'

# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/config.rb, line 25
def default_locale
  @@default_locale ||= :en
end
default_locale=(locale)

Sets the current default locale. Used to set a custom default locale.

# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/config.rb, line 30
def default_locale=(locale)
  @@default_locale = locale.to_sym rescue nil
end
default_separator()

Returns the current default scope separator. Defaults to '.'

# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/config.rb, line 47
def default_separator
  @@default_separator ||= '.'
end
default_separator=(separator)

Sets the current default scope separator.

# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/config.rb, line 52
def default_separator=(separator)
  @@default_separator = separator
end
exception_handler()

Return the current exception handler. Defaults to :default_exception_handler.

# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/config.rb, line 57
def exception_handler
  @@exception_handler ||= :default_exception_handler
end
exception_handler=(exception_handler)

Sets the exception handler.

# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/config.rb, line 62
def exception_handler=(exception_handler)
  @@exception_handler = exception_handler
end
load_path()

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'
# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/config.rb, line 74
def load_path
  @@load_path ||= []
end
load_path=(load_path)

Sets the load path instance. Custom implementations are expected to behave like a Ruby Array.

# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/config.rb, line 80
def load_path=(load_path)
  @@load_path = load_path
end
locale()

The only configuration value that is not global and scoped to thread is :locale. It defaults to the default_locale.

# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/config.rb, line 5
def locale
  @locale ||= default_locale
end
locale=(locale)

Sets the current locale pseudo-globally, i.e. in the Thread.current hash.

# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/config.rb, line 10
def locale=(locale)
  @locale = locale.to_sym rescue nil
end