# File lib/i18n/exceptions.rb, line 42 def initialize(locale, key, options = nil) @key, @locale, @options = key, locale, options.dup || {} options.each { |k, v| self.options[k] = v.inspect if v.is_a?(Proc) } end
# File lib/i18n/exceptions.rb, line 47 def html_message key = keys.last.to_s.gsub('_', ' ').gsub(%r\b('?[a-z])/) { $1.capitalize } %Q(<span class="translation_missing" title="translation missing: #{keys.join('.')}">#{key}</span>) end
# File lib/i18n/exceptions.rb, line 52 def keys @keys ||= I18n.normalize_keys(locale, key, options[:scope]).tap do |keys| keys << 'no key' if keys.size < 2 end end
# File lib/i18n/exceptions.rb, line 58 def message "translation missing: #{keys.join('.')}" end
# File lib/i18n/exceptions.rb, line 63 def to_exception MissingTranslationData.new(locale, key, options) end