Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Add additional reference for the custom fallbacks plugin

Rafal Cymerys130685ed752a
diff --git a/core/lib/mobility/plugins/store_based_fallbacks.rb b/core/lib/mobility/plugins/store_based_fallbacks.rb
index 0473dfce01..85dac38553 100644
--- a/core/lib/mobility/plugins/store_based_fallbacks.rb
+++ b/core/lib/mobility/plugins/store_based_fallbacks.rb
@@ -3,6 +3,10 @@
require 'concurrent'
require 'mobility'
+# The default implementation in the Mobility gem requires fallbacks to be defined when booting the application.
+# This patch allows to dynamically reconfigure translations fallbacks, by setting Mobility.store_based_fallbacks attribute.
+# The implementation is based on the default fallbacks plugin, with some changes around fetching the list of fallbacks to be used.
+# https://github.com/shioyama/mobility/blob/master/lib/mobility/plugins/fallbacks.rb
module Mobility
@store_based_fallbacks = Concurrent::ThreadLocalVar.new(I18n::Locale::Fallbacks.new)