Re: Why do I get redirected to a German page?

From: Date: Sun, 30 Mar 2003 11:35:58 +0000
Subject: Re: Why do I get redirected to a German page?
References: 1 2  Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-16525@lists.php.net to get a copy of this message
Please support the Accept-Language header; that's what it's there for. (Though at least you have the courtesy to set a cookie indicating the last language; if I change the URL by replacing "de" with "en", I get another cookie, which, I presume, would store my preference if I would accept it. But that's just a band-aid.)
We do parse the accept-language, and do store the last language seen already (for those many, who are not satisfied with their accept-langauge acceptance on php.net)...
It should really do that already, can you go to php.net/my.php to see if it is correctly parsed?
It is not: Your Accept-Language browser setting (parsed) de, en, en However, when I visit a CGI page I made which simply outputs the environment variables it receives, it says HTTP_ACCEPT_LANGUAGE = en-GB,en,de and that is the order I entered them into my browser (Opera 6.05 running under Windows 98; it shows "User-defined, [en-GB]" "English, [en]" "German, [de]" in the preferences box). Maybe this is because there are no weights attached to the individual choices (e.g. "en-GB;q=1.0, en;q=0.8, de;q=0.6")? But still, I thought the order was significant even if all languages have equal weight. Maybe the languages are sorted alphabetically so that "de" comes before "en"?
From the RFC: | Each language-range MAY be given an associated quality value which | represents an estimate of the user's preference for the languages | specified by that range. The quality value defaults to "q=1". So your accept-language means equal importance for all three languages set. I don't see anything in the RFC specific about language order. The q values indicate the order. BTW I don't see really why de comes first in your case after the parsing, because we have the languages in the right order and then usort() by quality,. which should not have the alphabetical order behaviour... Goba

« previous php.mirrors (#16525) next »