Site not respecting user locale preference from browser #5080
Labels
bug
Breaks expected functionality
f:user-profiles
stale
Issues with no activity for 12 months
user-experience
x:belgium
2 problems here:
Firstly, our code is not working as intended as when we call
set_gettext_locale
when the user visits the homepage for the first time - so the locale is not being passed in as part of the URL - we are forcibly providing the default locale rather than allowing a null value. This takes precedence so that the language doesn't constantly flip back after you've chosen one so the browser value is never considered[1].Secondly, when we ask
FastGetText
to pick the best match using the browser-supplied string, if it gets something like"nl,en-GB;q=0.7,en;q=0.3"
(mine, from Firefox, after adding Dutch for testing purposes), it's not going to match "nl" to "nl_BE" (it handles a string withnl-BE
just fine but we should handle both).(When fixed, check the site is configured with
use_default_browser_language
)[1] Applies when the site is configured so that the default locale is not included in the URL otherwise the browser settings will never be considered as there is, legitimately, always a locale param - that's a different, and currently theoretical, problem which is not addressed here.
The text was updated successfully, but these errors were encountered: