Page MenuHomePhabricator

Unexpected "In other languages" section in Vector 22 sidebar
Closed, ResolvedPublic4 Estimated Story Points

Assigned To
Authored By
Krinkle
Aug 11 2022, 5:42 PM
Referenced Files
F37121807: image.png
Jun 28 2023, 7:40 AM
F37119696: image.png
Jun 26 2023, 7:09 AM
F37119692: image.png
Jun 26 2023, 7:09 AM
F37119690: image.png
Jun 26 2023, 7:09 AM
F37119683: image.png
Jun 26 2023, 7:09 AM
F37119681: image.png
Jun 26 2023, 7:09 AM
F37119685: image.png
Jun 26 2023, 7:09 AM
F37119676: image.png
Jun 26 2023, 7:09 AM
Tokens
"Like" token, awarded by Quiddity.

Description

When logged-out:

AfterBefore
Screenshot 2022-08-11 at 18.29.40.png (1×2 px, 1 MB)
Screenshot 2022-08-11 at 18.29.32.png (1×2 px, 1 MB)

Note the empty "In other languages" section that appears in Vector 22, but not regular Vector.

Comparing the two screenshots side-by-side, it also stands out that there is quite a lot of space pushing down the title and content area. I don't know if that's intended or a recent regression e.g. some incompatibilties between different extensions perhaps causing that to be there by accident (perhaps due to CentralNotice?)

Screenshot 2022-08-11 at 19.01.12.png (788×2 px, 269 KB)

Event Timeline

Jdlrobson subscribed.

This seems to relate to T275147.
UniversalLanguageSelector is adding a hidden element .uls-after-portlet-link which stops it being an empty portlet. I'm not sure under what conditions it should show.

Presumably, this should not be added if the cog is not present?
https://gerrit.wikimedia.org/g/mediawiki/extensions/UniversalLanguageSelector/+/f8d2b54ff35cf3480c978ae0b22bbf743d5b1530/includes/Hooks.php#499

I'm seeing this on https://en.wikipedia.beta.wmflabs.org/wiki/Special:UserLogin:

Screen Shot 2022-08-11 at 6.51.11 PM.png (148×526 px, 8 KB)

Not sure if this is correct behaviour or not?

I don't think ULS is causing the extra whitespace, so we are not going to investigate that. "In other languages" section should only appear in wikies where $wgULSPosition = 'interlanguage' and when not using vector-2022.

Removing team tag after triage, but I have added this to Localization Infrastructure request list to be considered for future sprints.

Nikerabbit triaged this task as Medium priority.Nov 2 2022, 9:39 AM
Nikerabbit set the point value for this task to 4.Nov 2 2022, 12:17 PM

This ticket is a few months old. There is no "In other languages" as of today.

image.png (913×1 px, 553 KB)

It's at the bottom right now on the home page:

Screen Shot 2022-11-14 at 2.06.55 PM.png (92×1 px, 10 KB)

and in the header on normal pages:

Screen Shot 2022-11-14 at 2.07.13 PM.png (48×987 px, 7 KB)

Does office wiki have languages, or do we just need to disable this?
If it does, we should decline this ticket.
If it doesn't, I don't know if it's possible to disable the "add languages" feature. If not, perhaps we need that?

abi_ changed the task status from Open to In Progress.EditedDec 15 2022, 2:17 PM
abi_ subscribed.

I see In other languages appear on https://office.wikimedia.org/wiki/Special:BlankPage

I was debugging this issue and it appears to have started when 06091efcd057d86db397297e45821cda4cf35f1c was merged.

The patch forces a <span class="uls-after-portlet-link">...</span> to be added irrespective of the ULSPosition, which then causes $isEmptyPortlet to be false because $isEmptyAfterContent is false (See here).

This then causes the 'emptyPortlet' class to not be added to the sidebar portlet. This class adds display: none which hides the In other languages portlet.

I think we should try to avoid the implementation in 06091efcd057d86db397297e45821cda4cf35f1c and find a different approach to either add the span, or make things work without the span being present.

I think the article language selector should only be visible in the following cases:

  • If there are inter-language links that need to be displayed
  • If the page currently being displayed is a translatable page. This menu options listed can be updated the languages to which this page has been translated with an option to make further translations.

The interface language selector is still visible at the top of the page so no point having the "Add languages" trigger visible in that case.

image.png (455×667 px, 37 KB)

A comment from @Pginer-WMF summarizing our discussion regarding expected ULS behavior in monolingual wikis:

  • The selector on the user toolbar is for UI language (also setting the default language for content).
  • For pages available in multiple languages, we may want to present the current list of languages as a ULS selector. Making content language selection consistent with how is presented in Wikipedia, and the actions related to it (i.e., translate to more languages with Translate)
  • For pages not made available in multiple languages yet (but where it is possible to do so) we have to decide how much to emphasize/encourage making those translatable. Based on that present a prominent “Add languages” or a more discrete icon-only option to let people make the page translatable.

Some more context about why we're seeing this issue.

With this patch: 817894: Limit ULSPosition check to non-Vector 2022 skins | https://gerrit.wikimedia.org/r/c/mediawiki/extensions/UniversalLanguageSelector/+/817894 in Vector 2022, the lang portlet always has the empty span uls-after-portlet-link even if the ULSPosition is NOT interlanguage.

Now if a portlet is empty, then the SkinComponentMenu (https://github.com/wikimedia/mediawiki/blob/master/includes/skins/components/SkinComponentMenu.php#L95) in MediaWiki core will add an emptyPortlet class to the portlet section. The emptyPortlet class hides the entire portlet section. After the above patch, Vector 2022 the p-lang portlet is never empty and hence In other languages is visible whereas for other skins the emptyPortlet class gets added and hides it.

If I remove the code added in the patch, the issue is fixed but it screws up ULS when the Add Language / Language selector is displayed in the Vector header.

Change 930877 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/UniversalLanguageSelector@master] Correct the logic for the ULS settings cog

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

Change 930877 merged by jenkins-bot:

[mediawiki/extensions/UniversalLanguageSelector@master] Correct the logic for the ULS settings cog for Vector 2022

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

Not seeing this on translatewiki.net anymore. Will leave it open to verify on Officewiki.

Change 932446 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/UniversalLanguageSelector@master] Display the language button on pages without languages

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

It seems like the language button disappears from the bottom of the page if there are zero languages - meaning there is no longer a way to switch languages. See https://he.wikipedia.beta.wmflabs.org/wiki/Main_Page for example.
Language button has disappeared from user pages: https://en.wikipedia.beta.wmflabs.org/wiki/User:Jdlrobson

the hook returns before some important handling for when there are 0 languages.

This is possibly not a big deal (a it would mean inability to switch language on user page - not sure if that's a big deal), but marking this as as a deploy blocker for your consideration.

A few combinations with the latest patch from Job:

1. ULSPosition = personal on normal pages

image.png (699×1 px, 66 KB)

2. ULSPosition = interlanguage with VectorLanguageInHeader = false on normal pages

image.png (736×1 px, 79 KB)

3. ULSPosition = interlanguage with VectorLanguageInHeader = true on normal pages

image.png (731×1 px, 84 KB)

4. ULSPosition = interlanguage with PageTranslationLanguageList = sidebar-only and VectorLanguageInHeader = false on translatable pages

image.png (866×1 px, 91 KB)

5. ULSPosition = interlanguage with PageTranslationLanguageList = sidebar-only and VectorLanguageInHeader = true on translatable pages

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

6. ULSPosition = interlanguage with PageTranslationLanguageList = sidebar-fallback and VectorLanguageInHeader = true on translatable pages

Page having <languages> tag:

image.png (472×1 px, 44 KB)

Page without <languages> tag:

image.png (459×1 px, 22 KB)

7. ULSPosition = interlanguage with PageTranslationLanguageList = sidebar-fallback and VectorLanguageInHeader = false on translatable pages

image.png (601×1 px, 41 KB)

Change 932446 had a related patch set uploaded (by Abijeet Patro; author: Jdlrobson):

[mediawiki/extensions/UniversalLanguageSelector@master] Display the language button on pages without languages

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

Change 933154 had a related patch set uploaded (by Abijeet Patro; author: Jdlrobson):

[mediawiki/extensions/UniversalLanguageSelector@wmf/1.41.0-wmf.15] Display the language button on pages without languages

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

Change 932446 merged by jenkins-bot:

[mediawiki/extensions/UniversalLanguageSelector@master] Display the language button on pages without languages

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

Change 933154 merged by jenkins-bot:

[mediawiki/extensions/UniversalLanguageSelector@wmf/1.41.0-wmf.15] Display the language button on pages without languages

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

Mentioned in SAL (#wikimedia-operations) [2023-06-27T18:22:42Z] <brennen@deploy1002> Started scap: Backport for [[gerrit:933154|Display the language button on pages without languages (T315036)]]

Mentioned in SAL (#wikimedia-operations) [2023-06-27T18:24:36Z] <brennen@deploy1002> abi and brennen: Backport for [[gerrit:933154|Display the language button on pages without languages (T315036)]] synced to the testservers: mwdebug2002.codfw.wmnet, mwdebug1002.eqiad.wmnet, mwdebug2001.codfw.wmnet, mwdebug1001.eqiad.wmnet

Mentioned in SAL (#wikimedia-operations) [2023-06-27T18:31:35Z] <brennen@deploy1002> Finished scap: Backport for [[gerrit:933154|Display the language button on pages without languages (T315036)]] (duration: 08m 53s)

I no longer see In other languages in the https://office.wikimedia.org/wiki/Special:BlankPage but do see an empty Languages section appear on the Main Page:

image.png (780×739 px, 119 KB)

Seems like a problem with local wiki styles:
https://office.wikimedia.org/wiki/MediaWiki:Common.css#L-898

@Quiddity could you replace that line with . vector-main-menu-action-lang-alert-empty { display: none; } ?

Seems like a problem with local wiki styles:
https://office.wikimedia.org/wiki/MediaWiki:Common.css#L-898

@Quiddity could you replace that line with . vector-main-menu-action-lang-alert-empty { display: none; } ?

This is done. Resolving this ticket.

Tagging this with the previous quarter, since all the work was done during the last quarter.