Module: R18n::Helpers
- Defined in:
- lib/r18n-core/helpers.rb
Overview
Useful aliases. Set I18n object before use them:
R18n.set('en')
t.ok #=> "OK"
l Time.now, :human #=> "now"
r18n.locale.code #=> "en"
Instance Method Summary collapse
-
#l(*params) ⇒ Object
Localize object.
-
#r18n ⇒ Object
(also: #i18n)
Get current I18n object.
-
#t(*params) ⇒ Object
Translate message.
Instance Method Details
#l(*params) ⇒ Object
Localize object. Alias for r18n.l.
42 43 44 |
# File 'lib/r18n-core/helpers.rb', line 42 def l(*params) R18n.get.l(*params) end |
#r18n ⇒ Object Also known as: i18n
Get current I18n object.
31 32 33 |
# File 'lib/r18n-core/helpers.rb', line 31 def r18n R18n.get end |
#t(*params) ⇒ Object
Translate message. Alias for r18n.t.
37 38 39 |
# File 'lib/r18n-core/helpers.rb', line 37 def t(*params) R18n.get.t(*params) end |