Change DEFAULT_LOCALE
to not override unauthenticated users' browser language (#34535)
This commit is contained in:
parent
13b13c8726
commit
22ec828951
1 changed files with 1 additions and 1 deletions
|
@ -16,7 +16,7 @@ module Localized
|
||||||
def requested_locale
|
def requested_locale
|
||||||
requested_locale_name = available_locale_or_nil(params[:lang])
|
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 ||= 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
|
requested_locale_name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue