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)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: ckoehler, Assigned: osmose)

References

Details

(Whiteboard: [dev])

Attachments

(1 file)

No description provided.
Summary: Affiliates: Sort order of lang and country select should use unicode → Affiliates: Sort order of lang and country select should be unicode aware
Assignee: nobody → mkelly
Whiteboard: [dev+]
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.
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.
Whiteboard: [dev+] → [dev]
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?
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.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Attached image profile edit page.
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.
Status: RESOLVED → VERIFIED
Product: Websites → Firefox Affiliates
Product: Firefox Affiliates → Firefox Affiliates Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: