diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7ed36161cb..be5c9ff972 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -67,6 +67,9 @@ def locale_from_request_params end def set_locale + # Prevent leaking of I18n.locale between requests + I18n.locale = I18n.default_locale + return unless Flipper.enabled?(:localization, current_user) # TODO: Remove debug logging when feature flag is removed diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index bbfb869904..71352a9458 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -78,9 +78,8 @@ # (Un-stub before each example as needed, overriding with specific args) allow(Flipper).to receive(:enabled?).with(any_args).and_call_original - # Reset locale settings to defaults + # Reset default locale between examples I18n.default_locale = :en - I18n.locale = I18n.default_locale end end