Closed
Bug 687667
Opened 14 years ago
Closed 14 years ago
Affiliates: Sort order of lang and country select should be unicode aware
Categories
(Firefox Affiliates Graveyard :: affiliates.mozilla.org, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
1.0
People
(Reporter: ckoehler, Assigned: osmose)
References
Details
(Whiteboard: [dev])
Attachments
(1 file)
98.48 KB,
image/png
|
Details |
No description provided.
Reporter | ||
Updated•14 years ago
|
Summary: Affiliates: Sort order of lang and country select should use unicode → Affiliates: Sort order of lang and country select should be unicode aware
Updated•14 years ago
|
Assignee: nobody → mkelly
Whiteboard: [dev+]
Comment 2•14 years ago
|
||
Okay the languages are not sorted at all currently (wrong, but I spare you the details), this can be fixed with something like:
sorted(d.items(), key=lambda x: x[1])
For unicode-aware sorting, you could do something like this:
import locale
sorted(c, cmp=lambda x, y: locale.strcoll(x[1], y[1]))
Obviously more expensive. Also note that there are indications that this does not work on OSX, but on Linux.
Comment 3•14 years ago
|
||
If this will take you longer than two minutes to debug, I suggest running the countries through sorted (first command) as well, and leave the unicode-aware sorting as an improvement for a later time. Unicode-aware sorting is hard, let's not block the release on it.
Comment 4•14 years ago
|
||
For reference:
Discussion on how it *can* work: <http://stackoverflow.com/questions/1097908/how-do-i-sort-unicode-strings-alphabetically-in-python>
and that it won't on OSX: <http://stackoverflow.com/questions/3412933/python-not-sorting-unicode-properly-strcoll-doesnt-help>
Comment 5•14 years ago
|
||
Commit pushed to https://github.com/mozilla/affiliates
https://github.com/mozilla/affiliates/commit/ef5f9a46fbfa450997c63ef5284546b82d2d9106
Unicode-aware sort language and country lists.
bug 687667
Updated•14 years ago
|
Whiteboard: [dev+] → [dev]
Assignee | ||
Comment 6•14 years ago
|
||
I agree with Fred. We tried using strcoll, but the sorting doesn't work right. As it is the lists are both sorted by the byte value of the text, so any sorting issues are ones that users may have run into before on other sites and shouldn't be a huge deal.
cmore: Can we call this fixed and make true unicode sorting a 1.1 goal?
Comment 7•14 years ago
|
||
mkelly: yup, sounds good. We can call this fixed and I will open up another bug for unicode sorting and put it for 1.1.
Assignee | ||
Updated•14 years ago
|
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 8•14 years ago
|
||
Verified on prod. The sort order for countries on the profile edit page is correct.
Bug for updating to cover unicode sort is here: bug 690932.
Updated•14 years ago
|
Status: RESOLVED → VERIFIED
Updated•13 years ago
|
Product: Websites → Firefox Affiliates
Updated•9 years ago
|
Product: Firefox Affiliates → Firefox Affiliates Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•