Last Comment Bug 370387 - In Advanced/General/Choose "en-US" (set via intl.accept_languages) is not match to "en-us"
: In Advanced/General/Choose "en-US" (set via intl.accept_languages) is not mat...
Status: RESOLVED FIXED
:
Product: SeaMonkey
Classification: Client Software
Component: Preferences (show other bugs)
: Trunk
: All All
: -- trivial (vote)
: seamonkey2.1a3
Assigned To: Philip Chee
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-14 07:36 PST by bugzilla2005
Modified: 2010-07-25 19:25 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Patch (1.95 KB, patch)
2007-02-15 04:15 PST, Simon Montagu :smontagu
asaf: review+
Details | Diff | Splinter Review
Patch Sv1.0 Suite fix. (1.90 KB, patch)
2010-07-20 01:58 PDT, Philip Chee
neil: review+
neil: superreview+
Details | Diff | Splinter Review

Description bugzilla2005 2007-02-14 07:36:55 PST
User-Agent:       Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8.1.1) Gecko/20061221 Firefox/2.0.0.1
Build Identifier: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8.1.1) Gecko/20061221 Firefox/2.0.0.1

Advanced/General/Choose does not perform language tag matching in a case-insensitive manner: It does, e.g., not match "en-US" (set via intl.accept_languages) to "en-us (English/United States)"; instead, it simly displays "en-US" without the explanatory "(English/United States)" text.

But language tags are case-insensitive -- and uppercase country subtags are actually preferred (FWIW: maybe you could follow this convention as well.)

Reproducible: Always

Steps to Reproduce:
1. Set (using about:config) "intl.accept_languages" to "en-US"
2. Open Preferences/Advanced/General/Choose...

Actual Results:  
The "languages in order of prefernece" list now contains an "en-US" entry 

Expected Results:  
I would have expected to see either "en-US (English/United States)" or "en-us (English/United States)", since language tags are case-insensitive and hence a match for "en-US" ought to be found.

I stumbled upon this problem when manually setting intl.accept_languages to include de-DE-1901 as well; doing that I also normalized the country subtags to uppercase.
Comment 1 Simon Montagu :smontagu 2007-02-15 04:15:41 PST
Created attachment 255204 [details] [diff] [review]
Patch
Comment 2 Simon Montagu :smontagu 2007-02-15 04:29:58 PST
(In reply to comment #0)
> But language tags are case-insensitive -- and uppercase country subtags are
> actually preferred (FWIW: maybe you could follow this convention as well.)

This was suggested in bug 44063 and resolved INVALID. I may reconsider it in bug 356038.
Comment 3 Mano (::mano, needinfo? for any questions; not reading general bugmail) 2007-02-15 05:09:52 PST
Comment on attachment 255204 [details] [diff] [review]
Patch

r=mano
Comment 4 Simon Montagu :smontagu 2007-02-15 08:42:15 PST
Checked in. Keeping the bug open for suite.
Comment 5 Simon Montagu :smontagu 2007-02-15 08:52:42 PST
Reducing severity, since in suite you can add languages from the preferences UI without resorting to about:config, and that scenario doesn't have the bug.
Comment 6 Serge Gautherie (:sgautherie) 2008-06-11 15:03:48 PDT
(Filter "spam" on 'prefs-nobody-20080612'.)
Comment 7 Philip Chee 2010-07-20 01:58:24 PDT
Created attachment 458599 [details] [diff] [review]
Patch Sv1.0 Suite fix.

> Simon Montagu      2007-02-15 08:42:15 PST
> 
> Checked in. Keeping the bug open for suite.
Fix Suite (finally).
Comment 8 Philip Chee 2010-07-20 03:09:24 PDT
Pushed to comm-central.
http://hg.mozilla.org/comm-central/rev/0297879cb2d2

Note You need to log in before you can comment on or make changes to this bug.