instance method
store_default_translations
Ruby on Rails 2.3.18
Since v2.3.18 Last seen in v2.3.18Signature
store_default_translations(locale, key, options = {})
No documentation comment.
Parameters
-
localereq -
keyreq -
optionsopt = {}
Source
# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/backend/active_record/missing.rb, line 36
def store_default_translations(locale, key, options = {})
count, scope, default, separator = options.values_at(:count, *Base::RESERVED_KEYS)
separator ||= I18n.default_separator
keys = I18n.normalize_keys(locale, key, scope, separator)[1..-1]
key = keys.join(separator || I18n.default_separator)
unless ActiveRecord::Translation.locale(locale).lookup(key).exists?
interpolations = options.reject { |name, value| Base::RESERVED_KEYS.include?(name) }.keys
keys = count ? I18n.t('i18n.plural.keys', :locale => locale).map { |k| [key, k].join(separator) } : [key]
keys.each { |key| store_default_translation(locale, key, interpolations) }
end
end
Defined in activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/backend/active_record/missing.rb line 36
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in I18n::Backend::ActiveRecord::Missing