module I18n::MissingTranslation::Base
def initialize(locale, key, options = EMPTY_HASH)
def initialize(locale, key, options = EMPTY_HASH) @key, @locale, @options = key, locale, options.slice(*PERMITTED_KEYS) options.each { |k, v| self.options[k] = v.inspect if v.is_a?(Proc) } end
def keys
def keys @keys ||= I18n.normalize_keys(locale, key, options[:scope]).tap do |keys| keys << 'no key' if keys.size < 2 end end
def message
def message "translation missing: #{keys.join('.')}" end
def to_exception
def to_exception MissingTranslationData.new(locale, key, options) end