Class Index [+]

Quicksearch

I18n::MissingTranslation::Base

Attributes

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

Public Class Methods

new(locale, key, options = nil) click to toggle source
    # File lib/i18n/exceptions.rb, line 42
42:       def initialize(locale, key, options = nil)
43:         @key, @locale, @options = key, locale, options.dup || {}
44:         options.each { |k, v| self.options[k] = v.inspect if v.is_a?(Proc) }
45:       end

Public Instance Methods

html_message() click to toggle source
    # File lib/i18n/exceptions.rb, line 47
47:       def html_message
48:         key = keys.last.to_s.gsub('_', ' ').gsub(/\b('?[a-z])/) { $1.capitalize }
49:         %(<span class="translation_missing" title="translation missing: #{keys.join('.')}">#{key}</span>)
50:       end
keys() click to toggle source
    # File lib/i18n/exceptions.rb, line 52
52:       def keys
53:         @keys ||= I18n.normalize_keys(locale, key, options[:scope]).tap do |keys|
54:           keys << 'no key' if keys.size < 2
55:         end
56:       end
message() click to toggle source
    # File lib/i18n/exceptions.rb, line 58
58:       def message
59:         "translation missing: #{keys.join('.')}"
60:       end
Also aliased as: to_s
to_exception() click to toggle source
    # File lib/i18n/exceptions.rb, line 63
63:       def to_exception
64:         MissingTranslationData.new(locale, key, options)
65:       end
to_s() click to toggle source
Alias for: message

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.