Class: I18n::Backend::I81n

Inherits:
Simple
  • Object
show all
Defined in:
lib/i81n.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ I81n

Returns a new instance of I81n.



5
6
7
8
# File 'lib/i81n.rb', line 5

def initialize(options = {})
  @ignore = options[:ignore]
  super()
end

Instance Attribute Details

#ignoreObject (readonly)

Returns the value of attribute ignore.



3
4
5
# File 'lib/i81n.rb', line 3

def ignore
  @ignore
end

Instance Method Details

#lookup(locale, key, scope = [], options = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/i81n.rb', line 10

def lookup(locale, key, scope = [], options = {})
  return super if options.delete(:i81n) == false
  return super if options[:default]

  key_str = key.to_s
  if ignore && ignore =~ key_str
    super
  else
    super || key_str
  end
end