Page MenuHomePhabricator

Clicking the language button should load Universal Language Selector
Closed, ResolvedPublic3 Estimated Story Points

Description

Following up to T260738, clicking the language button with JavaScript enabled should load the universal language selector dialog.

UniversalLanguageSelector will enhance an existing button with the mw-interlanguage-selector class.

Acceptance criteria

  • The class mw-interlanguage-selector class is added to the button.
  • When ULS enhances the button, the hover effect should be disabled.

Notes

We may need to check the existence/state of the ULS module and use client-js to determine whether to disable the ULS hover effect.

QA steps

Event Timeline

@nray https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/635080 may be interesting reading prior to taking this on. I did try out a few things there.
,

Change 661804 had a related patch set uploaded (by Nray; owner: Nray):
[mediawiki/skins/Vector@master] POC: Add mw-interlanguage-selector class to language button & hide menu

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

nray subscribed.

The new button has 2 problems

  1. The label changes on pages without languages
  2. When the button is clicked no languages are showing due to a now invalid assumption in the UniversalLanguageSelector about where to find languages.

I've posted https://gerrit.wikimedia.org/r/c/mediawiki/extensions/UniversalLanguageSelector/+/661797 but we'll need to coordinate with the language team to get that merged.

The cog is currently hidden, but we're discussing that separately.

Change 661797 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/UniversalLanguageSelector@master] Modern Vector should be compatible with ULS

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

Change 661804 merged by jenkins-bot:
[mediawiki/skins/Vector@master] Add mw-interlanguage-selector class to language button & hide menu/arrow when appropriate

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

Change 661797 merged by jenkins-bot:
[mediawiki/extensions/UniversalLanguageSelector@master] Modern Vector should be compatible with ULS

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

Edtadros subscribed.

Test Result - Beta{F34105087

Status:
Environment: beta
OS: macOS Big Sur
Browser: Chrome, Firefox, Safari, Edge
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

Visit https://en.wikipedia.beta.wmflabs.org/wiki/Test_indicators and confirm you can switch to all 7 available languages

ChromeFirefoxSafariEdge
Screen Recording 2021-02-14 at 1.16.48 PM.mov.gif (850×902 px, 2 MB)
Screen Recording 2021-02-14 at 1.21.37 PM.mov.gif (850×902 px, 1 MB)
Screen Recording 2021-02-14 at 1.25.18 PM.mov.gif (850×902 px, 1 MB)

Check Firefox, Chrome, Safari, Edge (this can be deferred if a general QA of the feature later is being planned).
See Above.

@Jdlrobson The navigation works, but the target page shows 0 languages. Is that functioning as expected?

@Jdlrobson The navigation works, but the target page shows 0 languages. Is that functioning as expected?

That's fine.

ovasileva claimed this task.

Change 684984 had a related patch set uploaded (by Phuedx; author: Phuedx):

[mediawiki/extensions/UniversalLanguageSelector@master] Fire hook when opened via language button

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

Change 684984 had a related patch set uploaded (by Phuedx; author: Phuedx):

[mediawiki/extensions/UniversalLanguageSelector@master] Fire hook when user clicks language button

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

Change 684984 merged by jenkins-bot:

[mediawiki/extensions/UniversalLanguageSelector@master] Fire hook when user clicks language button

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