module I18n::Backend::Simple::Implementation
def lookup(locale, key, scope = [], options = EMPTY_HASH)
into multiple keys, i.e. currency.format is regarded the same as
nested translations hash. Splits keys or scopes containing dots
either key is nil, or locale, scope or key do not exist as a key in the
Looks up a translation from the translations hash. Returns nil if
def lookup(locale, key, scope = [], options = EMPTY_HASH) init_translations unless initialized? keys = I18n.normalize_keys(locale, key, scope, options[:separator]) keys.inject(translations) do |result, _key| return nil unless result.is_a?(Hash) unless result.has_key?(_key) _key = _key.to_s.to_sym return nil unless result.has_key?(_key) end result = result[_key] result = resolve_entry(locale, _key, result, Utils.except(options.merge(:scope => nil), :count)) if result.is_a?(Symbol) result end end