Sha256: 8da7ca2b6ab7a0ec8471582383277fd3e7b460f2f083af94860697a8f1a27edd

Contents?: true

Size: 542 Bytes

Versions: 2

Compression:

Stored size: 542 Bytes

Contents

require "exvo_globalize"
require "rails"
require "i18n"

module ExvoGlobalize
  class Engine < Rails::Engine
    initializer "exvo_globalize.configure_i18n" do |app|
      # chained backends; GlobalizeStore (database backed) first, then YAML files (fallback)
      I18n.backend = I18n::Backend::Chain.new(I18n::Backend::GlobalizeStore.new, I18n.backend)

      # caching layer
      I18n::Backend::GlobalizeStore.send(:include, I18n::Backend::Cache)
      I18n.cache_store = ActiveSupport::Cache.lookup_store(:memory_store)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
exvo_globalize-0.1.0 lib/exvo_globalize/engine.rb
exvo_globalize-0.0.2 lib/exvo_globalize/engine.rb