Exception: I18n::MissingTranslationData

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/i18n/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(locale, key, options) ⇒ MissingTranslationData

Returns a new instance of MissingTranslationData.



20
21
22
23
24
25
# File 'lib/i18n/exceptions.rb', line 20

def initialize(locale, key, options)
  @key, @locale, @options = key, locale, options
  keys = I18n.send(:normalize_translation_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.



19
20
21
# File 'lib/i18n/exceptions.rb', line 19

def key
  @key
end

#localeObject (readonly)

Returns the value of attribute locale.



19
20
21
# File 'lib/i18n/exceptions.rb', line 19

def locale
  @locale
end

#optionsObject (readonly)

Returns the value of attribute options.



19
20
21
# File 'lib/i18n/exceptions.rb', line 19

def options
  @options
end