Closed
Bug 643641
Opened 13 years ago
Closed 13 years ago
Twitter Party: locale detection doesn't recognize some locales in the ab-cd form
Categories
(www.mozilla.org :: General, defect)
www.mozilla.org
General
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: stas, Assigned: andre)
References
Details
Attachments
(2 files)
1.41 KB,
patch
|
pascalc
:
review+
|
Details | Diff | Splinter Review |
634.94 KB,
image/png
|
Details |
If the country part is given in the Accept Language header, the locale detection is broken -- it moves to the next locale in the header. I have a working patch.
Reporter | ||
Comment 1•13 years ago
|
||
Here's an example of this behavior:
> $ curl -sI -H'Accept-Language: en-us,en;q=0.7,ar;q=0.3' http://dev2.twitterparty.quodis.com/ | grep Location
> Location: http://dev2.twitterparty.quodis.com/ar
Reporter | ||
Comment 2•13 years ago
|
||
The issue was that once we got into the `if ($this->mapLonglocales == true)` part, the break statement would only break from the smaller loop (foreach ($this->supportedLocales as $var)), but the bigger loop would continue checking the next preferred locale in the Accept Language header.
Assignee: nobody → stas
Attachment #520811 -
Flags: review?(pascalc)
Comment 3•13 years ago
|
||
Comment on attachment 520811 [details] [diff] [review] Patch looks good to me and is a simplification of my code
Attachment #520811 -
Flags: review?(pascalc) → review+
Assignee | ||
Comment 5•13 years ago
|
||
commited updated in http://dev2.twitterparty.quodis.com/ and http://dev.twitterparty.quodis.com/ does it really fix? I think an issue with the white list still remains.
Reporter | ||
Comment 6•13 years ago
|
||
> curl -sI -H'Accept-Language: en-us,en;q=0.7,ar;q=0.3' http://dev2.twitterparty.quodis.com/ | grep Location
> Location: http://dev2.twitterparty.quodis.com/en-US
I think this is fixed now.
I would appreciate a thorough QA, though. FWIW, I tested with more combinations of the Accept Language header and it looked good.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 7•13 years ago
|
||
Verified FIXED: ohwhatagooseiam:~ stephendonner$ curl -sI -H'Accept-Language: en-us,en;q=0.7, ar;q=0.3' http://twitterparty.mozilla.org | grep Location Location: http://twitterparty.mozilla.org/en-US
Status: RESOLVED → VERIFIED
Comment 8•13 years ago
|
||
Reporter | ||
Comment 9•13 years ago
|
||
The fix for this was lost in a merge from the master branch: https://github.com/quodis/Twitter-Collage/commit/882bbf6a5ca6cf4bd93df012f2177774deb88d3a#diff-1
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 10•13 years ago
|
||
done updated on our server: curl -sI -H'Accept-Language: en-us,en;q=0.7,ar;q=0.3' http://dev-m.twitterparty.quodis.com/ | grep Location also marked Bug 645851 as Fixed
Status: REOPENED → RESOLVED
Closed: 13 years ago → 13 years ago
Resolution: --- → FIXED
Comment 11•13 years ago
|
||
Verified on quodis: curl -sI -H'Accept-Language: es,en;q=0.7,ar;q=0.3' http://dev-m.twitterparty.quodis.com/ | grep Location Location: http://dev-m.twitterparty.quodis.com/es
Comment 12•13 years ago
|
||
Verified on twittercollage.allizom.org curl -sI -H'Accept-Language: es,en;q=0.7,ar;q=0.3' http://twittercollage.allizom.org/| grep Location Location: http://twittercollage.allizom.org/es
Status: RESOLVED → VERIFIED
Updated•12 years ago
|
Component: www.mozilla.org/firefox → www.mozilla.org
Updated•12 years ago
|
Component: www.mozilla.org → General
Product: Websites → www.mozilla.org
You need to log in
before you can comment on or make changes to this bug.
Description
•