Sha256: fbe5ffdc90daef2a646268f6d556e2674d60d3624489cd91ce866279bdd922fd

Contents?: true

Size: 451 Bytes

Versions: 15

Compression:

Stored size: 451 Bytes

Contents

module Spree
  module Locales
    class SetFallbackLocaleForStore
      def call(store:)
        store_default_locale = store.default_locale
        fallbacks = store.supported_locales_list.each_with_object({}) do |locale, object|
          object[locale] = [store_default_locale]
        end

        fallbacks_instance = I18n::Locale::Fallbacks.new(fallbacks)

        Mobility.store_based_fallbacks = fallbacks_instance
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
spree_core-4.10.1 app/services/spree/locales/set_fallback_locale_for_store.rb
spree_core-4.10.0 app/services/spree/locales/set_fallback_locale_for_store.rb
spree_core-4.9.0 app/services/spree/locales/set_fallback_locale_for_store.rb
spree_core-4.8.3 app/services/spree/locales/set_fallback_locale_for_store.rb
spree_core-4.8.2 app/services/spree/locales/set_fallback_locale_for_store.rb
spree_core-4.7.3 app/services/spree/locales/set_fallback_locale_for_store.rb
spree_core-4.6.6 app/services/spree/locales/set_fallback_locale_for_store.rb
spree_core-4.6.5 app/services/spree/locales/set_fallback_locale_for_store.rb
spree_core-4.7.2 app/services/spree/locales/set_fallback_locale_for_store.rb
spree_core-4.7.1 app/services/spree/locales/set_fallback_locale_for_store.rb
spree_core-4.6.4 app/services/spree/locales/set_fallback_locale_for_store.rb
spree_core-4.7.0 app/services/spree/locales/set_fallback_locale_for_store.rb
spree_core-4.6.3 app/services/spree/locales/set_fallback_locale_for_store.rb
spree_core-4.6.2 app/services/spree/locales/set_fallback_locale_for_store.rb
spree_core-4.6.1 app/services/spree/locales/set_fallback_locale_for_store.rb