The bug
minecraft.net ignores q-factor weighting for the Accept-Language
header value.
This header specifies the preferred languages in which a website should be served and the q-factors allow specifying in which order the languages are preferred. With Firefox this can be set under the "Language" setting.
For example when choosing English, else German else Danish, the header might look like this:
Accept-Language: en,de;q=0.7,da;q=0.3
However, minecraft.net apparently completely ignores the weights and instead iterates over the languages in an arbitrary (possibly string hash code-based) order, serving Danish first, then German and then English.
How to reproduce
Set a preferred language English (en), then Danish (da)
Open https://minecraft.net
❌ You are redirected to https://www.minecraft.net/da-dk/ instead of /en-us/
Linked issues
is duplicated by 1
relates to 1
Attachments
Comments 9
I see.
I use Linux mint, and my preferred browser is Chrome (version 76.0.3809.132 ).
My OS langauge is set to US english, if that matters.
Since you brought up browser language as a factor, I decided to do some testing and experimenting.
The only other browser program I have installed, is Firefox (version 68.0.2).
When opening minecraft.net in Firefox, I am redirected to /en-us/.
So it seems the browser is indeed a factor.
Firefox language settings is set to [en-us], with [en] as secondary.
Chrome still redirects to /da-dk/.
Checking the language settings of Chrome, "English (United States)" is set as my standard language.
However since Chrome likes to nag about translating websites, all languages I can read, including danish, are on the language list (so it won't nag).
My browser-language list in Chrome is:
English (United States)
English
Norwegian Bokmål
Danish
Swedish
I tried reversing the order, randomize, reorder.
Every change has the same result. I am redirected to /da-dk/.
When removing Danish from the list, I am however redirected to /sv-se/.
Altering the order in the list has again no effect.
When next removing Swedish, I get redirected to /en-us/.
Next I tried removing either version of English (then re-adding the other).
In both cases I got redirected to /en-us/
When removing all but Norwegian Bokmål, I am not redirected.
The website url stays as minecraft.net, with english text.
Puzzled by this, I decided to add Norwegian Nynorsk, a secundary version of norwegian.
No re-direct.
When restoring the lanaguge list to what it was, I am back to /da-dk/.
This is indeed quite odd.
So I decided to test by adding Danish and Swedish to Firefox.
Just like in Chrome, no matter the order in the language list in Firefox, redirect goes the /da-dk/.
But here is something even more odd.
Adding Norwegian to Firefox's list results in a redirect to /nb-no/, the Norwegian version.
Based on this, I think I may have revealed two issues.
1: The backend code ignores the order of prefrence of the browser lanagues, and instead returns first matching lanague (both browsers).
2: Redirect to norwegian version of minecraft.net is broken for Chrome, but not for Firefox.
I hope this helps you folks to figure this out. If you want more details, let me know.
That was really helpful, thank you very much! I have rewritten the report, I hope that is alright for you. Could you please create a separate report for the Norwegian languages?
Looks a bit dry.. I mean, you did remove my highly unprofessional, yet mergially funny rant. 😃
But off course, this is something your developers are going to have to use, so it has to look clean. So thank you for that.
As requested, I created a seperate issue for the failing redirect for norwegain. It got the id "WEB-1598".
I hope my formatting is acceptable.
It might have become a little bit too dry since the users here should understand it as well, but I hope it works. Thanks for the other report, yes the formatting is fine.
My Windows language/region setting is English / United States.
Using Chrome (on Windows 10) I consistently get redirected to es-es page.
Using Microsoft Edge (also on Windows 10) I get redirected to ja-jp page.
Umja5895M I use Microsoft edge on Windows 10. These are the languages I use:
English (United Kingdom)
English
English (United States)
Romanian (Primary Language)
Redirects me to minecraft.net/en-us and I don't bother.
Tho when I had Danish (Bottom of the list) it redirected me to minecraft.net/da-dk.
INTERESTING.
Windows 10 Chrome Im keep getting redirects to da-dk every link, funny enough, my wife keep geeting nb-no, We are in Poland. Even if we change language in bottom of the page it keep getting back to those langauges.
It appears the language detection is based on IP instead of browser language (
Accept-Language
header). Do you have Norwegian set as your preferred language in the browser?