(Translated by https://www.hiragana.jp/)
⚓ T302200 No language variant found after clicking language-selector on pages that not in site's default content language in Minerva skin
Page MenuHomePhabricator

No language variant found after clicking language-selector on pages that not in site's default content language in Minerva skin
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • (Assume we are on a site installed translate extension)
  • Enable Minerva skin
  • Go to a translatable page, open its subpage which language converter is used on corresponding language (i.e. zh)
  • Click "language-selector" icon on top left (example, pageinfo-language is "zh - Chinese")

What happens?:
Nothing shown in language list.

image.png (360×750 px, 21 KB)

What should have happened instead?:
It should show language variants option. We use zhwiki as an example:

image.png (1×750 px, 90 KB)

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:
1.38.0-wmf.22 (529f223)

QA Results - Beta

ACStatusDetails
1T302200#8559528

QA Results - Prod

ACStatusDetails
1T302200#8567013

Event Timeline

Func subscribed.

MobileFrontend is what to blame, this interface is provided by it.

Jdlrobson renamed this task from No language variant found after clicking language-selector in Minerva skin to No language variant found after clicking language-selector on language subpage in Minerva skin.Feb 22 2022, 4:01 PM
Jdlrobson subscribed.

The MobileFrontend overlay uses API and core methods to work out what languages to show. The Translate extension doesn't register subpages as languages in a way that MobileFrontend understands.

There is another ticket open somewhere about merging the two languages entry points on mobile and that seems like it would need to happen first.

Screen Shot 2022-02-22 at 8.05.35 AM.png (818×2 px, 254 KB)

@Nikerabbit could what we did T64702 on translate wiki be applied to wikis like Commons / mediawiki.org to solve this problem?

The MobileFrontend overlay uses API and core methods to work out what languages to show. The Translate extension doesn't register subpages as languages in a way that MobileFrontend understands.

We are talking about variants, I believe this can happen when we changing the page language manually, and Translate extension don't need to register variants.

Func renamed this task from No language variant found after clicking language-selector on language subpage in Minerva skin to No language variant found after clicking language-selector on pages that not in site's default content language in Minerva skin.Feb 22 2022, 4:28 PM

And I didn't found any API to get/fetch the page language property, there's only one for "set page language".

Change 764827 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/extensions/MobileFrontend@master] Fix issues when deprecating Language::getVariants() and Language::hasVariants() methods

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

And I didn't found any API to get/fetch the page language property, there's only one for "set page language".

I can only fix the part handeled by the special page (Special:MobileLanguages), need someone to fix the JavaScript-driven variant-interlanguage menu.

And I didn't found any API to get/fetch the page language property, there's only one for "set page language".

Content language of page is available at mw.config.get( 'wgPageContentLanguage' ) but variants is missing, maybe some core change is needed.

Stang added a subscriber: Shizhao.

@Shizhao "...Also, please do not add this tag for issues about /zh pages on multilingual sites (Meta-Wiki, Commons, Wikidata, etc.)"

@Nikerabbit could what we did T64702 on translate wiki be applied to wikis like Commons / mediawiki.org to solve this problem?

That is T204076: Consider moving page translation language links to the sidebar.

Ok, it's actually related to MinervaNeue, the document claim that MF is a soft dependency, but the "Language" button relies on MF's Special:MobileLanguage...
I can't simply add data attr to the button, since it only works with MF.

Change 769047 had a related patch set uploaded (by Func; author: Func):

[mediawiki/core@master] ApiQueryLanguageinfo: Allow fetching variant name from API

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

Change 769151 had a related patch set uploaded (by Func; author: Func):

[mediawiki/extensions/MobileFrontend@master] PageGateway: Fetch language variants from languageinfo API

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

Change 764827 abandoned by Winston Sung:

[mediawiki/extensions/MobileFrontend@master] Fix variants links in Special:MobileLanguages for multi-language wikis

Reason:

Merged into 769151: Fix variants links for multi-language wikis | https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MobileFrontend/+/769151

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

@Shizhao "...Also, please do not add this tag for issues about /zh pages on multilingual sites (Meta-Wiki, Commons, Wikidata, etc.)"

Change 769047 merged by jenkins-bot:

[mediawiki/core@master] ApiQueryLanguageinfo: Allow fetching variant names from API

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

Jdlrobson added a subscriber: ovasileva.

@ovasileva we have a volunteer patch. Can you find a good time to bring this into the sprint board for code review?

As far as I can see, this hasn't been mentioned yet, but this bug doesn't only affect translatable pages; pages on the Wikimedia Incubator get the content language set according to the prefix, so a page with the prefix "Wq/tg/" gets its content language set to Tajik (tg). That leads to there being a clickable but empty language selector in Minerva when it should have been possible to select a language variant (as opposed to the unclickable one when there are no interlanguage links at all). Example page: https://incubator.m.wikimedia.org/wiki/Wq/tg/Зарбулмасалҳои_русӣ

(This interfers with the way the Interwiki gadget on Incubator works on mobile – it makes the unclickable language selector into a "add interwiki link" for pages without interwiki links, but that doesn't work for languages like tg because the button is clickable even though it has no content. The gadget is enabled for all registered users by default if you want to test.)

Presumably it would be the same on any page where the page language is set to a language with variants (e.g. via Special:PageLanguage) that is different from the wiki's content language, regardless of whether the page is part of a translatable page or not.

ovasileva triaged this task as Medium priority.Nov 17 2022, 4:26 PM

The patch is for MoblieFrontend, I think this should not fall into tracking tag.

Jdlrobson lowered the priority of this task from Medium to Low.Jan 17 2023, 9:55 PM

@Func is there a page on the beta cluster we can QA this on?

Change 769151 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Fix variants links for multi-language wikis

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

@Func is there a page on the beta cluster we can QA this on?

Maybe no, but we can create a page on non-zh sites and mark that page for translation to zh.
@Stang, could you help with the preparation? I saw you are admin and translation admin on beta clusters.

@Func The main page is fine enough. I see it works now, thanks!

image.png (1×940 px, 53 KB)

Test Result - Beta

Status: ✅ PASS
Environment: enbeta, zhbeta
OS: macOS Ventura
Browser: Chrome
Device: MBP
Emulated Device:iPhone 12 Pro

Test Artifact(s):

QA Steps

List of steps to reproduce (step by step, including full links if applicable):

(Assume we are on a site installed translate extension)
Enable Minerva skin
Go to a translatable page, open its subpage which language converter is used on corresponding language (i.e. zh)
Click "language-selector" icon on top left (example, pageinfo-language is "zh - Chinese")
✅ AC1: It should show language variants option.

zh.m.wikipedia.beta.wmflabs.org_wiki_Text(iPhone 12 Pro).png (2×1 px, 251 KB)

incubator.m.wikimedia.beta.wmflabs.org_wiki_Wp_tg_T302200(iPhone 12 Pro).png (2×1 px, 92 KB)

Edtadros subscribed.

Test Result - Prod

Status: ✅ PASS
Environment: zhwiki
OS: macOS Ventura
Browser: Chrome
Device: MBP
Emulated Device:iPhone 12 Pro

Test Artifact(s):

QA Steps

List of steps to reproduce (step by step, including full links if applicable):

(Assume we are on a site installed translate extension)
Enable Minerva skin
Go to a translatable page, open its subpage which language converter is used on corresponding language (i.e. zh)
Click "language-selector" icon on top left (example, pageinfo-language is "zh - Chinese")
✅ AC1: It should show language variants option.

Screenshot 2023-01-28 at 5.05.40 PM.png (969×1 px, 76 KB)