Class: Translatomatic::I18n
- Inherits:
-
Object
- Object
- Translatomatic::I18n
- Defined in:
- lib/translatomatic/i18n.rb
Overview
I18n initialisation and translation fallback handling
Class Method Summary collapse
-
.l(object, options = {}) ⇒ Object
Localises dates and numbers to local formatting.
-
.t(key, options = {}) ⇒ Object
Get string translation.
Class Method Details
.l(object, options = {}) ⇒ Object
Localises dates and numbers to local formatting
19 20 21 |
# File 'lib/translatomatic/i18n.rb', line 19 def l(object, = {}) ::I18n.l(object, ) end |
.t(key, options = {}) ⇒ Object
Get string translation
10 11 12 13 14 15 |
# File 'lib/translatomatic/i18n.rb', line 10 def t(key, = {}) tkey = "translatomatic.#{key}" raise "missing translation: #{tkey}" unless ::I18n.exists?(tkey) ::I18n.t(tkey, .merge(locale: t_locale())) end |