When I open links like https://www.php.net/stat, it opens chinese version of documentation.
It is caused by header Accept-Language: cs,en;q=0.9,fr;q=0.8,zh-CN;q=0.7,zh;q=0.6
When I change it to Accept-Language: cs,en;q=0.9,fr;q=0.8 (remove chinese), it sends me to english version
That is not expected, because language should be chosen by priority - czech (no q parameter is implicitly 1, highest), english, french and then chinese. Czech is not supported by php.net, therefore english version should open.
This is proper implementation that returns supported language that has the highest priority: https://github.com/nette/http/blob/a02f3d131f8a5dbd573244a6813ed316cde8d6ad/src/Http/Request.php#L308-L335
Here is proof: https://3v4l.org/UJnKb#vnull
Possibly related to #435
I have fresh Windows 11 and Opera installation and for some reason french and chinese were added without me doing that and seeing chinese docs when my system is set to czech and english was really confusing.
I don't feel quite confident with the website codebase, so this will hopefully allow you to fix the current behavior. Thank you
When I open links like https://www.php.net/stat, it opens chinese version of documentation.
It is caused by header
Accept-Language: cs,en;q=0.9,fr;q=0.8,zh-CN;q=0.7,zh;q=0.6When I change it to
Accept-Language: cs,en;q=0.9,fr;q=0.8(remove chinese), it sends me to english versionThat is not expected, because language should be chosen by priority - czech (no q parameter is implicitly 1, highest), english, french and then chinese. Czech is not supported by php.net, therefore english version should open.
This is proper implementation that returns supported language that has the highest priority: https://github.com/nette/http/blob/a02f3d131f8a5dbd573244a6813ed316cde8d6ad/src/Http/Request.php#L308-L335
Here is proof: https://3v4l.org/UJnKb#vnull
Possibly related to #435
I have fresh Windows 11 and Opera installation and for some reason french and chinese were added without me doing that and seeing chinese docs when my system is set to czech and english was really confusing.
I don't feel quite confident with the website codebase, so this will hopefully allow you to fix the current behavior. Thank you