# File lib/i18n/backend/chain.rb, line 35 def available_locales backends.map { |backend| backend.available_locales }.flatten.uniq end
# File lib/i18n/backend/chain.rb, line 60 def localize(locale, object, format = :default, options = {}) backends.each do |backend| catch(:exception) do result = backend.localize(locale, object, format, options) and return result end end throw(:exception, I18n::MissingTranslation.new(locale, format, options)) end
# File lib/i18n/backend/chain.rb, line 27 def reload! backends.each { |backend| backend.reload! } end
# File lib/i18n/backend/chain.rb, line 31 def store_translations(locale, data, options = {}) backends.first.store_translations(locale, data, options) end
# File lib/i18n/backend/chain.rb, line 39 def translate(locale, key, default_options = {}) namespace = nil options = default_options.except(:default) backends.each do |backend| catch(:exception) do options = default_options if backend == backends.last translation = backend.translate(locale, key, options) if namespace_lookup?(translation, options) namespace ||= {} namespace.merge!(translation) elsif !translation.nil? return translation end end end return namespace if namespace throw(:exception, I18n::MissingTranslation.new(locale, key, options)) end
Generated with the Darkfish Rdoc Generator 2.