Page MenuHomePhabricator

New Universal­Language­Selector doesn't list language converter variants in MinervaNeue skin
Open, HighPublic4 Estimated Story PointsBUG REPORT

Assigned To
Authored By
Peterxy12
Sun, May 17, 9:41 AM
Referenced Files
F86910607: 屏幕截图 2026-06-06 145130.png
Sat, Jun 6, 6:53 AM
F86906884: 屏幕截图 2026-06-06 142830.png
Sat, Jun 6, 6:29 AM
F86460195: image.png
Wed, Jun 3, 6:14 PM
F84903970: image.png
Thu, May 28, 3:04 PM
F84903882: image.png
Thu, May 28, 3:04 PM
F82116116: Screenshot_20260517_173749.jpg
Sun, May 17, 9:41 AM

Description

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

What happens?:

  • The various language converter variants (i.e. the Chinese variants in this example) aren't listed in the ULS

What should have happened instead?:

  • They should be listed under "Suggested languages", in the same way the are if you disable the ULS rewrite in beta features and otherwise follow the same steps

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

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

Screenshot_20260517_173749.jpg (1,080×2,192 px, 145 KB)

Event Timeline

jhsoby renamed this task from New Universal­Language­Selector can't switch Chinese variants in MinervaNeue skin to New Universal­Language­Selector doesn't list language converter variants in MinervaNeue skin.Sun, May 17, 10:22 AM
jhsoby updated the task description. (Show Details)
jhsoby updated the task description. (Show Details)
jhsoby subscribed.

As you can see, I edited the description to make it clearer how to reproduce this, hope you don't mind. :-)

abi_ moved this task from Backlog to In Progress on the LPL Essential (FY2025-26 Q3&4) board.
abi_ set the point value for this task to 4.
abi_ subscribed.

I looked into this. The variants were never shown by ULS itself. On mobile, the old language button opened MobileFrontend's own language overlay, not ULS. That overlay read variants directly from the page DOM (the #p-variants element that MediaWiki renders for wikis with language converters like Chinese), and added them to the "Suggested languages" list. The code is in MobileFrontend/src/mobile.startup/PageHTMLParser.js (the getLanguages() function).

When the ULS rewrite beta is on, MinervaNeue gives the click to ULS V2 instead of opening MobileFrontend's overlay (see initMobile.js in MinervaNeue, the wgULSLanguageSelectorV2Enabled branch). ULS V2 then builds its list by reading only #p-lang / .interlanguage-link-target. It does not read #p-variants. The rewrite has no code for language variants at all.

It is a missing feature in the rewrite. To fix it, the rewrite needs to:

  1. Also read entries from #p-variants li a when building its language list (in getLanguageNodes() in resources/js/ext.uls.interface.js).
  2. Show them in a sensible place. "Suggested languages" matches the old behavior. Variants are not real interlanguage links, so they may need a small adapter as they do not have the same hreflang and autonym fields.

Note that making this change would affect both the desktop and mobile versions of the language selector.

Change #1293760 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/UniversalLanguageSelector@master] ULS rewrite: Show language variants for the selected language

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

Based on the spec (page 22) for variant handling, I've submitted a patch and deployed it on the patch demo: https://bd4346ecd8.catalyst.wmcloud.org/wiki/ManyLanguages/zh

image.png (1,036×418 px, 53 KB)

Here's a screenshot from the spec:

image.png (1,170×780 px, 86 KB)

Change #1293760 merged by jenkins-bot:

[mediawiki/extensions/UniversalLanguageSelector@master] ULS rewrite: Show language variants for the selected language

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

I see an unexpected item on itwiki mobile:

image.png (971×690 px, 88 KB)

I don't see it on desktop though.

But I can't see language variants in metawiki.

屏幕截图 2026-06-06 142830.png (784×1,714 px, 50 KB)