Exception: I18n::MissingTranslationData
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- ArgumentError
- I18n::MissingTranslationData
- Defined in:
- lib/i18n/exceptions.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(locale, key, options) ⇒ MissingTranslationData
constructor
A new instance of MissingTranslationData.
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, ) @key, @locale, @options = key, locale, keys = I18n.send(:normalize_translation_keys, locale, key, [:scope]) keys << 'no key' if keys.size < 2 super "translation missing: #{keys.join(', ')}" end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
19 20 21 |
# File 'lib/i18n/exceptions.rb', line 19 def key @key end |
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
19 20 21 |
# File 'lib/i18n/exceptions.rb', line 19 def locale @locale end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
19 20 21 |
# File 'lib/i18n/exceptions.rb', line 19 def @options end |