Module: Avm::Sources::Base::Locale
- Defined in:
- lib/avm/sources/base/locale.rb
Constant Summary collapse
- LOCALE_KEY =
'locale'
Instance Method Summary collapse
- #configured_locale ⇒ Object
- #default_locale ⇒ Object
- #i18n_translate(entry_suffix, values = {}) ⇒ String
- #locale ⇒ Object
Instance Method Details
#configured_locale ⇒ Object
16 17 18 |
# File 'lib/avm/sources/base/locale.rb', line 16 def configured_locale configuration_entry(LOCALE_KEY).value end |
#default_locale ⇒ Object
20 21 22 |
# File 'lib/avm/sources/base/locale.rb', line 20 def default_locale ::I18n.default_locale end |
#i18n_translate(entry_suffix, values = {}) ⇒ String
27 28 29 |
# File 'lib/avm/sources/base/locale.rb', line 27 def i18n_translate(entry_suffix, values = {}) self.class.i18n_translate(entry_suffix, values.merge(__locale: locale)) end |
#locale ⇒ Object
12 13 14 |
# File 'lib/avm/sources/base/locale.rb', line 12 def locale configured_locale || default_locale end |