class Chain
Ruby on Rails 2.3.18
Since v2.3.18 Last seen in v2.3.18Backend that chains multiple other backends and checks each of them when a translation needs to be looked up. This is useful when you want to use standard translations with a Simple backend but store custom application translations in a database or other backends.
To use the Chain backend instantiate it and set it to the I18n module. You can add chained backends through the initializer or backends accessor:
# preserves the existing Simple backend set to I18n.backend I18n.backend = I18n::Backend::Chain.new(I18n::Backend::ActiveRecord.new, I18n.backend)
The implementation assumes that all backends added to the Chain implement a lookup method with the same API as Simple backend does.
Inherits from
Includes
Attributes
Methods (defined here)
- # available_locales
- # localize
- # namespace_lookup?
- # reload!
- # store_translations
- # translate
- self. new
Methods (inherited)
From I18n::Backend::Base (16)
- # available_locales
- # default
- # interpolate
- # interpolate_lambda?
- # load_file
- # load_rb
- # load_translations
- # load_yml
- # localize
- # lookup
- # pluralize
- # preserve_encoding
- # reload!
- # resolve
- # store_translations
- # translate
From Object (37)
- # acts_like?
- # app
- # as_json
- # blank?
- # class_eval
- # create
- # create_fixtures
- # destroy
- # duplicable?
- # edit
- # find_cmd
- # helper
- # html_safe?
- # index
- # instance_exec
- # instance_variable_defined?
- # instance_variable_names
- # message
- # metaclass
- # new_session
- # presence
- # present?
- # reload!
- # returning
- # singleton_class
- # tap
- # to_json
- # to_param
- # to_query
- # try
- # unescape
- # update
- # with_options
- self. blank_slate_method_added
- self. find_hidden_method
- self. lookup_missing_generator
- self. method_added
From I18n::Backend::Transliterator (2)
- # transliterate
- self. get