Affiliates: Sort order of lang and country select should be unicode aware

VERIFIED FIXED in 1.0

Status

Firefox Affiliates Graveyard
affiliates.mozilla.org
VERIFIED FIXED
7 years ago
2 years ago

People

(Reporter: ckoehler, Assigned: mkelly)

Tracking

unspecified
x86_64
Linux

Details

(Whiteboard: [dev])

Attachments

(1 attachment)

Comment hidden (empty)
(Reporter)

Updated

7 years ago
Duplicate of this bug: 686494
(Reporter)

Updated

7 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

7 years ago
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.

Updated

7 years ago
Whiteboard: [dev+] → [dev]
(Assignee)

Comment 6

7 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

7 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

7 years ago
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Created attachment 568226 [details]
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.

Updated

7 years ago
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.