Muhammad Kamal
Muhammad Kamal

Reputation: 344

Http Accept Language Wrong Output From Chrome, German Language (de)

I have a multilanguage website. Using htaccess

 # Another Languages
 #RewriteCond %{HTTP:Accept-Language} ^en [NC]
 #RewriteRule ^$ /en [R=301,L]

 # German
 #RewriteCond %{HTTP:Accept-Language} ^de [NC]
 #RewriteRule ^$ /de [R=301,L]

Problem:

I use the German version of the latest chrome browser. On default, it sends out the following language header:

Chrome /de = string(71) "en-US,en;q=0.8,id;q=0.6,ms;q=0.4,fr;q=0.2,de;q=0.2,es;q=0.2,de-AT;q=0.2"
Chrome /en = string(71) "en-US,en;q=0.8,id;q=0.6,ms;q=0.4,fr;q=0.2,de;q=0.2,es;q=0.2,de-AT;q=0.2"

But in Firefox and IE :

Firefox /de = string(53) "de,en;q=0.8,en-US;q=0.7,es;q=0.5,fr;q=0.3,de-AT;q=0.2" 
Firefox /en = string(53) "en,en-US;q=0.8,de;q=0.7,es;q=0.5,fr;q=0.3,de-AT;q=0.2" 

IE /de = string(74) "de,en-GB;q=0.9,de-AT;q=0.7,de-DE;q=0.6,de-LI;q=0.4,de-LU;q=0.3,de-CH;q=0.1"  
IE /en = string(74) "en-GB,de;q=0.9,de-AT;q=0.7,de-DE;q=0.6,de-LI;q=0.4,de-LU;q=0.3,de-CH;q=0.1" 

As you can see, English has a higher priority then German. So anybody also got this problem?

Upvotes: 1

Views: 1463

Answers (2)

Muhammad Kamal
Muhammad Kamal

Reputation: 344

In Chrome, despite clicking the 'Display Google Chrome In This Language', also need to re-order German language into top of the order, so the Http:Accept-Language will redirecting into /de

Upvotes: 0

Denis Mysenko
Denis Mysenko

Reputation: 6534

Try going to "Preferences", "Languages and input settings" in Chrome and adding German as one of the browser languages.

Different browsers use different algorithms to detect users' preferred languages and then populate Accept-Language headers with them.

For example, you computer may have English and German locales installed, but user tends to use English interface of Chrome and visit mostly English websites – Chrome may give higher priority to English, even though the user is German or the computer is in Germany.

There is no 100% accurate method of detecting users language, but one may assume that if Accept-Language header lists English as one of the top languages – this user does know the language on a level good enough to be able to switch the language later. In short, Chrome has reasons to believe you understand en-US.

Upvotes: 1

Related Questions