Closed Bug 621389 Opened 14 years ago Closed 13 years ago

SUMO doesn't always choose the correct values from Accept-Language

Categories

(support.mozilla.org :: Knowledge Base Software, task)

task
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: JasnaPaka, Assigned: jsocol)

References

()

Details

Attachments

(2 files)

I use latest Firefox 4.0 in czech version. When I try to visit SUMO (URL: http://support.mozilla.com/) I'm redirected to the en-US version. Not sure why. My expectation is that I should be redirected to the czech (cs) version (http://support.mozilla.com/cs/).

I'm not sure if it's related but I see familiar problem with articles too. One example. When I try to visit article which doesn't have translation I'm redirected to the en-US version of SUMO. With old SUMO there was no redirect to the en-US version. In other words I saw czech (cs) SUMO (GUI) with english article

Visit:
http://support.mozilla.com/cs/kb/what-are-app-tabs

You are redirected to the page:
http://support.mozilla.com/en-US/kb/what-are-app-tabs

My expectation:
* Stay on the same URL and show english version of the article.
Pavel, would you mind filing a separate bug for the article issue? That's a design decision and unrelated to the wrong-locale issue.

For the issue in this bug, can you attach headers for a request that goes to the wrong place?
Attached file HTTP Headers
HTTP Headers in *.har. You can show it online: http://www.softwareishard.com/har/viewer/
(In reply to comment #1)
> Pavel, would you mind filing a separate bug for the article issue? That's a
> design decision and unrelated to the wrong-locale issue.

Filled Bug 622151.
A dupe of bug 591828?
Bug 591828 is an AMO bug, not a SUMO bug.
Summary: SUMO doesn't redirect correctly to the localized versions of SUMO → SUMO doesn't redirect correctly to the localized versions of SUMO in localized browsers with accept language="locale,en-us;q=0.7,en;q=0.3"
Scoobidiver: do you have headers or any other information that supports the change to the summary?
> Scoobidiver: do you have headers or any other information that supports the
> change to the summary?
The previous title was not clear enough. This behaviour is caused by 2 conditions: a localized browser AND more than one content language (local as main and for instance English as secondary).
The accept language header can take different forms:
* "cs,en-us;q=0.7,en;q=0.3"
* "fr-fr,en-us;q=0.7,en;q=0.3"
* "nb,no;q=0.8,nn;q=0.6,en-us;q=0.4,en;q=0.2"
See bug 591828 and bug 582075 (especially comment 4) for more information.
(In reply to comment #8)
> The accept language header can take different forms:
> * "cs,en-us;q=0.7,en;q=0.3"
> * "fr-fr,en-us;q=0.7,en;q=0.3"
> * "nb,no;q=0.8,nn;q=0.6,en-us;q=0.4,en;q=0.2"

Are any of these specifically, reliably causing problems?

We use Django's parse_accept_lang_header method, which, except for some floating-point mistakes, parses all of those headers correctly.
Summary: SUMO doesn't redirect correctly to the localized versions of SUMO in localized browsers with accept language="locale,en-us;q=0.7,en;q=0.3" → SUMO doesn't always choose the correct values from Accept-Language
> Are any of these specifically, reliably causing problems?
I tried with different headers:
* Accept-Language: fr-FR,en-US;q=0.5
* Accept-Language: fr-fr,fr;q=0.7,en-us;q=0.3
* Accept-Language: fr,fr-fr;q=0.7,en-us;q=0.3
* Accept-Language: fr-fr,fr;q=0.8,en-us;q=0.5,en;q=0.3
I was redirected to en-US SUMO a few minutes ago, now to it SUMO, and never to fr SUMO. Clearing history does not change anything.
I am using French Windows with French settings (in numbers , is used as separator instead of .).
(In reply to comment #11)
> I am using French Windows with French settings (in numbers , is used as
> separator instead of .).

That should not change the format of the Accept-Language header. The values in comment 10 are the correct format. That you got to 'it' and that it's not 100% consistent tells me this is probably a thread-safety issue.
Assignee: nobody → james
Target Milestone: --- → 2.7
We think these patches will fix it:

https://github.com/jsocol/kitsune/compare/b0cb526c%5E...a1c8afee

Please reopen if it doesn't.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Verified on support.allizom.org(http and https) with the following first preferred languages: fr, fr-fr, en-US, it, vi, cs.
Verified using variations of this: curl -sI -H'Accept-Language: nb,no;q=0.8,nn;q=0.6,en-us;q=0.4,en;q=0.2' http://support.allizom.org/ | grep Location
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: