Closed
Bug 386434
Opened 18 years ago
Closed 16 years ago
Add-ons aren't sorted correctly in Add-ons manager (problem with non-ascii chars)
Categories
(Toolkit :: Add-ons Manager, defect)
Toolkit
Add-ons Manager
Tracking
()
RESOLVED
FIXED
mozilla1.9.1a2
People
(Reporter: JasnaPaka, Assigned: regis.caspar+bz)
Details
Attachments
(3 files)
1.72 KB,
patch
|
mossop
:
review+
|
Details | Diff | Splinter Review |
44.47 KB,
image/jpeg
|
Details | |
3.34 KB,
patch
|
mossop
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Win98; cs; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Win98; cs; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
Tested with Firefox 2.0.0.4 but same problem with latest Firefox Trunk.
Reproducible: Always
Steps to Reproduce:
1. Install Czech dictionary from https://addons.mozilla.org/en-US/firefox/browse/type:3.
Actual Results:
In Add-ons manager have add-ons this sequence:
* DOM Inspector
* Talkback
* České slovníky pro kontrolu pravopisu
Expected Results:
Right sequence is:
* České slovníky pro kontrolu pravopisu
* DOM Inspector
* Talkback
Updated•17 years ago
|
Product: Firefox → Toolkit
Comment 2•17 years ago
|
||
Should be a fairly simple fix replacing the alphabetic comparison with something more locale aware.
Whiteboard: [good first bug]
Assignee | ||
Comment 3•16 years ago
|
||
Here's a patch proposal using String.localCompare (will attach screenshot showing results)
Attachment #333913 -
Flags: review?(dtownsend)
Assignee | ||
Comment 4•16 years ago
|
||
Assignee | ||
Updated•16 years ago
|
Status: NEW → ASSIGNED
Comment 5•16 years ago
|
||
Comment on attachment 333913 [details] [diff] [review]
patch proposal
Excellent, thanks. Just a quick tip for the future, it helps to provide more context with the patches, 8 lines is normally recommended.
Say if you are unable to check in.
Attachment #333913 -
Flags: review?(dtownsend) → review+
Suggestion: remove the 'toLowerCase' calls. They are no longer needed because localeCompare sorts 'a' next to 'A' (unlike '<' and '>' which compare unicode codes). For example:
old '>' and '<' sorts by Unicode code:
["a", "b", "c", "d","A", "B", "C", "D", "Č"].sort(function compare(a,b) a<b? -1 : a > b? 1 : 0)
--> A,B,C,D,a,b,c,d,Č
new localeCompare sorts upper and lowercase adjacent:
["a", "b", "c", "d","A", "B", "C", "D", "Č"].sort(String.localeCompare)
--> a,A,b,B,c,C,Č,d,D
Assignee | ||
Comment 7•16 years ago
|
||
Same patch as before (with context) and without toLowerCase() calls. I also changed the comment above the compare function to "Locale sensitive sort".
Tested with Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1a2pre) Gecko/20080814225749 Minefield/3.1a2pre ID:20080814225749 (custom build)
Assignee: nobody → regis.caspar+bz
Comment 8•16 years ago
|
||
Comment on attachment 334070 [details] [diff] [review]
patch v2
Nice, thanks
Attachment #334070 -
Flags: review+
Assignee | ||
Updated•16 years ago
|
Keywords: checkin-needed
Comment 9•16 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [good first bug]
Target Milestone: --- → mozilla1.9.1a2
You need to log in
before you can comment on or make changes to this bug.
Description
•