Class: I18n::Backend::Chain

Inherits:
Object show all
Includes:
Implementation
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/i18n-1.12.0/lib/i18n/backend/chain.rb

Overview

Backend 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.

Defined Under Namespace

Modules: Implementation

Constant Summary

Constants included from Transliterator

Transliterator::DEFAULT_REPLACEMENT_CHAR

Instance Attribute Summary

Attributes included from Implementation

#backends

Method Summary

Methods included from Implementation

#available_locales, #eager_load!, #exists?, #initialize, #initialized?, #localize, #reload!, #store_translations, #translate

Methods included from Base

#available_locales, #eager_load!, #exists?, #load_translations, #localize, #reload!, #store_translations, #translate

Methods included from Transliterator

get, #transliterate