use env for localization to avoid db round trip

This commit is contained in:
simon lehericey 2021-04-06 14:55:25 +02:00
parent cd4ad6878c
commit b87a691176
3 changed files with 4 additions and 2 deletions

View file

@ -309,7 +309,7 @@ class ApplicationController < ActionController::Base
end
def set_locale
if feature_enabled?(:localization)
if ENV.fetch('LOCALIZATION_ENABLED', 'false') == 'true'
I18n.locale = http_accept_language.compatible_language_from(I18n.available_locales)
end
end