Change DEFAULT_LOCALE to not override unauthenticated users' browser language (#34535)

This commit is contained in:
Claire authored and GitHub committed 2025-04-24 11:38:27 +00:00
1 parent 13b13c8726
commit 22ec828951
1 file changed
+1 -1
+1 -1
View File
@@ -16,7 +16,7 @@ module Localized
def requested_locale
requested_locale_name = available_locale_or_nil(params[:lang])
requested_locale_name ||= available_locale_or_nil(current_user.locale) if respond_to?(:user_signed_in?) && user_signed_in?
requested_locale_name ||= http_accept_language if ENV['DEFAULT_LOCALE'].blank?
requested_locale_name ||= http_accept_language unless ENV['FORCE_DEFAULT_LOCALE'] == 'true'
requested_locale_name
end