Page MenuHomePhabricator

Sorting alphabetically should account for diacritics
Open, In Progress, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

In a language with diacritics (using French in this example) view the country dropdown in Special:EnableEventRegistration or Special:EditEventRegistration, which is sorted alphabetically

What happens?:
Diacritics are sorted to the end of the alphabet, after all letters without diacritics.

What should have happened instead?:
Letters with diacritics should be sorted in the appropriate order.

So in the above in the image (using French) Bénin should go after Belize, and Côte d'Ivoire should go after Costa Rica, etc.
Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Bénin in incorrect placeCôte d'Ivoire in incorrect place
Screenshot 2025-08-04 at 3.27.14 PM.png (782×886 px, 90 KB)
Screenshot 2025-08-04 at 3.21.48 PM.png (260×346 px, 17 KB)

Event Timeline

This affects: country, type, topics. Example of the same issue elsewhere: T391230#10992632. As done there, it looks like proper alphasorting isn't easier to achieve in PHP; I didn't find a MW utility that does it, and Collator might be the best option. Watch out for T400710 though.

Change #1203476 had a related patch set uploaded (by Mhorsey; author: Mhorsey):

[mediawiki/extensions/CampaignEvents@master] Implement custom sorting to maintain diacritics

https://gerrit.wikimedia.org/r/1203476

Change #1203476 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Implement custom sorting to maintain diacritics in country selector

https://gerrit.wikimedia.org/r/1203476

✅ Letters with diacritics should be sorted in the appropriate order.

This is now working as expected and words containing diacritics are correctly sorted alphabetically in the country list

Screenshot 2025-12-03 at 1.43.59 PM.png (266×354 px, 15 KB)
Screenshot 2025-12-03 at 1.44.34 PM.png (380×454 px, 33 KB)
Screenshot 2025-12-03 at 1.46.26 PM.png (304×638 px, 28 KB)

sending to product sign off