Module: I18nliner::Extensions::Model

Includes:
Inferpolation
Defined in:
lib/i18nliner/extensions/model.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Inferpolation

#inferpolate, #inferpolate_value!

Class Method Details

.included(klass) ⇒ Object



27
28
29
# File 'lib/i18nliner/extensions/model.rb', line 27

def self.included(klass)
  klass.extend(self)
end

Instance Method Details

#i18nliner_scopeObject



10
# File 'lib/i18nliner/extensions/model.rb', line 10

def i18nliner_scope; end

#localize(*args) ⇒ Object Also known as: l



22
23
24
# File 'lib/i18nliner/extensions/model.rb', line 22

def localize(*args)
  I18n.localize(*args)
end

#translate(*args) ⇒ Object Also known as: t, t!, translate!



12
13
14
15
16
17
# File 'lib/i18nliner/extensions/model.rb', line 12

def translate(*args)
  key, options = CallHelpers.infer_arguments(args)
  options = inferpolate(options) if I18nliner.infer_interpolation_values
  options[:i18nliner_scope] = i18nliner_scope
  I18n.translate(key, options)
end