Class: Carioca::Services::I18n

Inherits:
Object
  • Object
show all
Defined in:
lib/carioca/services/i18n.rb

Class Method Summary collapse

Class Method Details

.get(default_locale:, load_path:, locales_availables:) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/carioca/services/i18n.rb', line 6

def self.get(default_locale:, load_path:, locales_availables:)
  ::I18n::Backend::Simple.include(::I18n::Backend::Fallbacks)
  ::I18n.load_path << load_path
  ::I18n.default_locale = default_locale
  ::I18n.fallbacks = locales_availables
  ::I18n
end

.system_localeObject



14
15
16
# File 'lib/carioca/services/i18n.rb', line 14

def self.system_locale
  ::Locale.candidates.to_s.split('_').first.to_sym
end