From 288cd367bc89979a77d26d69e977cad479c5ef18 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Mon, 13 Mar 2023 15:02:05 +0100 Subject: [PATCH] Add I18N to all reflexes --- app/reflexes/application_reflex.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/reflexes/application_reflex.rb b/app/reflexes/application_reflex.rb index 7fc8b6cc3d..ff41bf8288 100644 --- a/app/reflexes/application_reflex.rb +++ b/app/reflexes/application_reflex.rb @@ -23,4 +23,8 @@ class ApplicationReflex < StimulusReflex::Reflex def current_ability Spree::Ability.new(current_user) end + + def with_locale(&block) + I18n.with_locale(current_user.locale, &block) + end end