diff --git a/lib/i18n/exceptions.rb b/lib/i18n/exceptions.rb index 98e6a781..df32d6db 100644 --- a/lib/i18n/exceptions.rb +++ b/lib/i18n/exceptions.rb @@ -30,10 +30,13 @@ class MissingTranslationData < ArgumentError def initialize(locale, key, opts = nil) @key, @locale, @options = key, locale, opts.dup || {} options.each { |k, v| options[k] = v.inspect if v.is_a?(Proc) } + super "translation missing: #{keys.join(', ')}" + end + def keys keys = I18n.normalize_keys(locale, key, options[:scope]) keys << 'no key' if keys.size < 2 - super "translation missing: #{keys.join(', ')}" + keys end end @@ -68,4 +71,4 @@ def initialize(type, filename) super "can not load translations from #{filename}, the file type #{type} is not known" end end -end \ No newline at end of file +end