Page MenuHomePhabricator

Languages are not alphabetically sorted in the about dialog
Closed, ResolvedPublic

Description

Current, languages are sorted by creation date.

CleanShot 2024-01-26 at 15.52.14@2x.jpg (1×2 px, 315 KB)

Desired, sorted alphabetically.

CleanShot 2024-01-26 at 15.58.44@2x.jpg (1×2 px, 308 KB)

Event Timeline

Jdforrester-WMF subscribed.

Should it definitely be alphabetical? By label in current view? By language code? Or in descending likely priority based on user's location, like ULS?

Should it definitely be alphabetical? By label in current view? By language code? Or in descending likely priority based on user's location, like ULS?

i was updating the task description with the latest updates to the about widget because i thought this was fixed, but i later discovered that is fixed only under certain conditions.

for instance, if we check Z12812 with the UI language set to english everything appears to be correct:

  • we have suggested languages
  • we have other languages alphabetically sorted

CleanShot 2024-12-12 at 10.41.58@2x.png (1×2 px, 454 KB)

but if we check the same object with the UI language set to lombard, this is what happens:

  • we have suggested languages
  • we have other languages that are alphabetically sorted except french

CleanShot 2024-12-12 at 10.46.44@2x.png (1×2 px, 489 KB)

Should it definitely be alphabetical? By label in current view? By language code? Or in descending likely priority based on user's location, like ULS?

i was updating the task description with the latest updates to the about widget because i thought this was fixed, but i later discovered that is fixed only under certain conditions.

for instance, if we check Z12812 with the UI language set to english everything appears to be correct:

  • we have suggested languages
  • we have other languages alphabetically sorted

CleanShot 2024-12-12 at 10.41.58@2x.png (1×2 px, 454 KB)

but if we check the same object with the UI language set to lombard, this is what happens:

  • we have suggested languages
  • we have other languages that are alphabetically sorted except french

CleanShot 2024-12-12 at 10.46.44@2x.png (1×2 px, 489 KB)

It's probably not practical, but could we grab the babel information from the user page? For example, when I was logged in, it would fetch https://www.wikifunctions.org/wiki/User:Feeglgeef and get English, Hungarian, Latin, German, Spanish, and Dagbani.

It's probably not practical, but could we grab the babel information from the user page? For example, when I was logged in, it would fetch https://www.wikifunctions.org/wiki/User:Feeglgeef and get English, Hungarian, Latin, German, Spanish, and Dagbani.

yeah, that's how wikidata[1] suggests languages inside their label box.

CleanShot 2024-12-17 at 11.01.21@2x.png (1×1 px, 140 KB)

for this first iteration we opted for using the mediawiki fallback language API[2] given that was "for free". that said, we would def like to give editors more control over the suggested languages.

[1]: https://www.wikidata.org/wiki/Help:Navigating_Wikidata/User_Options#Babel_extension
[2]: https://www.mediawiki.org/wiki/Manual:Language#Fallback_languages

What is now expected here as an outcome @AAlhazwani-WMF In the previous comments that isn't entirely clear to me yet.

What is now expected here as an outcome @AAlhazwani-WMF In the previous comments that isn't entirely clear to me yet.

hey @DSmit-WMF my comment is still valid https://phabricator.wikimedia.org/T355951#10399965.

if we check https://www.wikifunctions.org/view/en/Z10000 the 'other languages' are correctly sorted alphabetically (UI lang set to EN)

CleanShot 2025-02-03 at 15.37.03@2x.png (1×2 px, 353 KB)

while if we check https://www.wikifunctions.org/view/it/Z10000 the 'other languages' are not sorted alphabetically (UI lang set to IT). or better, they are sorted alphabetically but based on the locale. first all the languages with the lang label in EN, and then at the bottom the languages with lang label in IT.

CleanShot 2025-02-03 at 15.38.15@2x.png (1×2 px, 342 KB)

what i think it's happening is that we are not sorting the whole list whether the language label is available in the user locale or not. that's why with the UI lang set to IT, you first see all the languages with the fallback label in english, and then at the bottom of the list the languages for which a language label is available in italian

CleanShot 2025-02-03 at 15.38.15@2x.png (1×2 px, 466 KB)

Change #1118504 had a related patch set uploaded (by Daphne Smit; author: Daphne Smit):

[mediawiki/extensions/WikiLambda@master] AboutLanguagesDialog: Languages are now alphabetically sorted

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

Change #1118504 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] AboutLanguagesDialog: Languages are now alphabetically sorted

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