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

View file

@ -69,3 +69,6 @@ DS_ENV="staging"
# Active le mode maintenance
# MAINTENANCE_MODE="true"
# Active la localisation
# LOCALIZATION_ENABLED="true"

View file

@ -32,7 +32,6 @@ features = [
:expert_not_allowed_to_invite,
:hide_instructeur_email,
:instructeur_bypass_email_login_token,
:localization,
:make_experts_notifiable,
:procedure_routage_api
]