I18n::MissingTranslationData

Attributes

key[R]
locale[R]
options[R]

Public Class Methods

new(locale, key, opts = nil) click to toggle source
# File lib/i18n/exceptions.rb, line 39
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

Public Instance Methods

html_message() click to toggle source
# File lib/i18n/exceptions.rb, line 45
def html_message
  key = keys.last.to_s.gsub('_', ' ').gsub(/\b('?[a-z])/) { $1.capitalize }
  %(<span class="translation_missing" title="translation missing: #{keys.join('.')}">#{key}</span>)
end
keys() click to toggle source
# File lib/i18n/exceptions.rb, line 50
def keys
  @keys ||= I18n.normalize_keys(locale, key, options[:scope]).tap do |keys|
    keys << 'no key' if keys.size < 2
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.