Sha256: 71defaf0ed615c1d977c1d2feb7f2425c6629abe33e84aa91a453b73dffe4e6d

Contents?: true

Size: 487 Bytes

Versions: 19

Compression:

Stored size: 487 Bytes

Contents

# frozen_string_literal: true

module Carioca
  module Services
    class I18n
      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

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

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
carioca-2.1.10 lib/carioca/services/i18n.rb
carioca-2.1.9 lib/carioca/services/i18n.rb
carioca-2.1.8 lib/carioca/services/i18n.rb
carioca-2.1.7 lib/carioca/services/i18n.rb
carioca-2.1.6 lib/carioca/services/i18n.rb
carioca-2.1.5 lib/carioca/services/i18n.rb
carioca-2.1.4 lib/carioca/services/i18n.rb
carioca-2.1.3 lib/carioca/services/i18n.rb
carioca-2.1.2 lib/carioca/services/i18n.rb
carioca-2.1.1 lib/carioca/services/i18n.rb
carioca-2.1.0 lib/carioca/services/i18n.rb
carioca-2.0.12 lib/carioca/services/i18n.rb
carioca-2.0.11 lib/carioca/services/i18n.rb
carioca-2.0.10 lib/carioca/services/i18n.rb
carioca-2.0.9 lib/carioca/services/i18n.rb
carioca-2.0.8 lib/carioca/services/i18n.rb
carioca-2.0.7 lib/carioca/services/i18n.rb
carioca-2.0.6 lib/carioca/services/i18n.rb
carioca-2.0.5 lib/carioca/services/i18n.rb