Update app/controllers/application_controller.rb

Co-authored-by: Pierre de La Morinerie <pierre.de_la_morinerie@beta.gouv.fr>
This commit is contained in:
lydiasan 2021-05-25 13:32:26 +02:00 committed by GitHub
parent 71069c0e1b
commit e85dcf4c58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -313,7 +313,7 @@ class ApplicationController < ActionController::Base
locale = nil
if cookies[:locale]
locale = cookies[:locale]
elsif ENV['LOCALIZATION_ENABLED'] == 'enabled'
elsif ENV.fetch('LOCALIZATION_ENABLED', 'false') == 'true'
locale = http_accept_language.compatible_language_from(I18n.available_locales)
else
locale = I18n.default_locale