Page MenuHomePhabricator

The language code 'de-DE' is ignored in Accept-Language HTTP header
Open, Needs TriagePublic

Description

In UniversalLanguageSelector with $wgULSLanguageDetection = true the HTTP header

Accept-Language: de-DE, de-AT;q=0.8, de-CH;q=0.6, de;q=0.4, nl;q=0.2

leads to the language code de-AT.

Expected language code is de-DE or de.

Details

Related Gerrit Patches:

Event Timeline

Fomafix created this task.Dec 19 2017, 9:05 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 19 2017, 9:05 PM
Fomafix updated the task description. (Show Details)

Change 399341 had a related patch set uploaded (by Fomafix; owner: Fomafix):
[mediawiki/core@master] Introduce language codes 'de-de' and 'en-us'

https://gerrit.wikimedia.org/r/399341

I disagree with the expected result to some extend. You should send de-DE, de;q=0.9 to get your expected result.

Of course when you set

Accept-Language: de-DE, de;q=0.9

then you get de.

But the

Accept-Language: de-DE, de-AT;q=0.9, de;q=0.8

is a standard conform and widespread configuration. The expected result is de-DE or de, but the current result is de-AT.

Here another example for the inconsistency:

Accept-Language: en-GB, en-US;q=0.9, en;q=0.8

and

Accept-Language: en-GB, en-US;q=0.9

selects en-gb

But

Accept-Language: en-US, en-GB;q=0.9, en;q=0.8

and

Accept-Language: en-US, en-GB;q=0.9

also selects en-gb.

Here another example for the inconsistency:

Accept-Language: en-GB, en-US;q=0.9, en;q=0.8

and

Accept-Language: en-GB, en-US;q=0.9

selects en-gb
But

Accept-Language: en-US, en-GB;q=0.9, en;q=0.8

and

Accept-Language: en-US, en-GB;q=0.9

also selects en-gb.

See T33874: Preferences and lang codes should distinguish "English" from "American English"/"U.S. English" for that part.

Fomafix updated the task description. (Show Details)Mar 8 2018, 9:45 AM
revi added a subscriber: revi.Mar 25 2018, 8:05 AM
Amire80 moved this task from Untriaged to Language codes issues on the I18n board.Apr 2 2018, 11:57 AM

Change 399341 had a related patch set uploaded (by Fomafix; owner: Fomafix):
[mediawiki/core@master] Introduce language codes 'de-de', 'en-us', 'ko-kr' and 'pt-pt'

https://gerrit.wikimedia.org/r/399341