Exception: I18n::MissingTranslationData

Inherits:
ArgumentError show all
Defined in:
lib/active_support/vendor/i18n-0.4.1/i18n/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(locale, key, opts = nil) ⇒ MissingTranslationData

Returns a new instance of MissingTranslationData.



22
23
24
25
26
27
# File 'lib/active_support/vendor/i18n-0.4.1/i18n/exceptions.rb', line 22

def initialize(locale, key, opts = nil)
  @key, @locale, @options = key, locale, opts || {}
  keys = I18n.normalize_keys(locale, key, options[:scope])
  keys << 'no key' if keys.size < 2
  super "translation missing: #{keys.join(', ')}"
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



21
22
23
# File 'lib/active_support/vendor/i18n-0.4.1/i18n/exceptions.rb', line 21

def key
  @key
end

#localeObject (readonly)

Returns the value of attribute locale.



21
22
23
# File 'lib/active_support/vendor/i18n-0.4.1/i18n/exceptions.rb', line 21

def locale
  @locale
end

#optionsObject (readonly)

Returns the value of attribute options.



21
22
23
# File 'lib/active_support/vendor/i18n-0.4.1/i18n/exceptions.rb', line 21

def options
  @options
end