Page MenuHomePhabricator

Language switching: put an alert in the sidebar about where the language links are
Closed, ResolvedPublic3 Estimated Story Points

Description

Background

As part of our explorations in increasing the visibility of the new language switching button, we would like to explore ways to link to the button from the previous location of language switching functionality.

Design

image.png (1×3 px, 1 MB)

Acceptance criteria / QA

  • The sidebar alert should not show on the main page
  • The sidebar alert should show on pages which has a language button
  • If there is no language button, do not show the sidebar alert.
  • This should be feature flagged and default to false

Developer notes

Something like this should suffice:

diff --git a/includes/templates/Sidebar.mustache b/includes/templates/Sidebar.mustache
index 3a916ba3e..63a3bf970 100644
--- a/includes/templates/Sidebar.mustache
+++ b/includes/templates/Sidebar.mustache
@@ -21,4 +21,8 @@
        {{^is-language-in-header}}
        {{#data-portlets.data-languages}}{{>Menu}}{{/data-portlets.data-languages}}
        {{/is-language-in-header}}
+       {{#is-language-in-header}}
+       <h2>{{msg-languages}}</h2>
+       <div class="warningbox">{{msg-language-redirect-to-top}}</div>
+       {{/is-language-in-header}}
 </div>

Signoff criteria

  • Create a task to remove the notice ~2 months after full rollout of the new button location - T297237

QA steps

  • Navigate to an article page with the config for language button in header and note that the language switching alert notice is in the sidebar by testing with the following local config:
$wgVectorLanguageInHeader = [
	"logged_in" => true,
	"logged_out" => true
];

$wgVectorLanguageAlertInSidebar = [
	"logged_in" => true,
	"logged_out" => false
];
  • Test different permutations of the above config:
    • When VectorLanguageInHeader['logged_in"] is true:
      • Alert should appear when VectorLanguageAlertInSidebar['logged_in"] is true

Screen Shot 2021-12-07 at 1.35.17 PM.png (1×2 px, 662 KB)

      • No alert should appear when VectorLanguageAlertInSidebar['logged_in"] is false
    • When VectorLanguageInHeader['logged_in"] is false:
      • No alert should appear when VectorLanguageAlertInSidebar['logged_in"] is true or false
    • When VectorLanguageInHeader['logged_out"] is true:
      • Alert should appear when VectorLanguageAlertInSidebar['logged_out"] is true
      • No alert should appear when VectorLanguageAlertInSidebar['logged_out"] is false
    • When VectorLanguageInHeader['logged_out"] is false:
      • No alert should appear when VectorLanguageAlertInSidebar['logged_out"] is true or false
  • Test the query parameter ?languagealertinsidebar=1 as override to see the language alert in sidebar in the cases where VectorLanguageInHeader is true and VectorLanguageAlertInSidebar is false
  • Navigate to the Main Page and note that the language switching alert notice is not shown when the config is set to show the alert.

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

@ovasileva indicated putting a link in the sidebar that would scroll the person up to the top of the page. Curious what you think of this from a technical perspective?

I think this is fine, and should be straightforward to build. We have a Sidebar component, so this would be a case of adding a static non-configurable menu at the bottom,
Would this be temporary or permanent?

@Jdlrobson - temporary should work, but it will depend on what the data looks like on our new wikis. The current expectation would be to remove ~2 months after we have all the wikis on the new vector. I'll add a note to create a task for that in the task description.

Change 744872 had a related patch set uploaded (by Clare Ming; author: Clare Ming):

[mediawiki/skins/Vector@master] Add langugage switching alert in sidebar for language in header

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

cjming removed cjming as the assignee of this task.Dec 7 2021, 8:46 PM
cjming moved this task from Doing to Code Review on the Web-Team-Backlog (Kanbanana-FY-2021-22) board.
cjming subscribed.
cjming moved this task from Doing to Code Review on the Web-Team-Backlog (Kanbanana-FY-2021-22) board.
Jdlrobson changed the point value for this task from 2 to 3.
cjming removed cjming as the assignee of this task.Dec 9 2021, 9:15 PM
cjming moved this task from Doing to Code Review on the Web-Team-Backlog (Kanbanana-FY-2021-22) board.

Change 744872 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Add language switching alert in sidebar for language in header

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

cjming updated the task description. (Show Details)

First impression community feedback:

  • In MediaWiki:Vector-language-redirect-to-top, "on this wiki" or "on this {{ns:Project}}" or sth similar should be used instead of "on this Wikipedia" (not all pilot wikis are Wikipedias)
  • Would it be feasible to only put the alert on pages that (1) may and (2) already have interlanguage links?
    • On special pages with no interlanguage links and on history pages, the interlanguage links list wouldn't be displayed anyway
    • If there's no interlanguage links list, the #p-lang-btn link is misleading
    • Some sister projects collect content that is rarely connected across wikis. It often doesn't make sense to use the alert (meaning, it does sometimes, but relatively more rarely than on Wikipedia)

Hi, there is a problem with the French message: "Sur ce Wikipédia, les liens de langue sont en haut de la page en face du titre de l’article. Aller en haut."

"Sur ce Wikipédia" is wrong: the message is also for other Wikimedia sister projects, and in French grammatical gender of Wikipedia is feminine. We should write instead "Sur ce wiki, les liens interlingues sont déplacés en haut de la page en face du titre de l’article. Aller en haut."

I'm not sure where you see that French message. See https://translatewiki.net/wiki/MediaWiki:Vector-language-redirect-to-top/fr for the default translation.

I'm not sure where you see that French message. See https://translatewiki.net/wiki/MediaWiki:Vector-language-redirect-to-top/fr for the default translation.

"On this Wikipedia" is wrong, the correct message is "On this wiki", because sister projects show the message too (p.e. Wikiquote is not Wikipedia). In French the message should be "Sur ce wiki,", not "Sur cette version linguistique de Wikipédia,".

Who can, please change the message, I can't modify it because I have not the permission.

@Patafisik: Translations are done on the translatewiki.net website. You can create an account there, change translations, and after a few days they will be updated automatically on Wikimedia websites. For more information, see https://www.mediawiki.org/wiki/Translatewiki.net - thanks.

Jdlrobson added a subscriber: Edtadros.

First impression community feedback:

  • In MediaWiki:Vector-language-redirect-to-top, "on this wiki" or "on this {{ns:Project}}" or sth similar should be used instead of "on this Wikipedia" (not all pilot wikis are Wikipedias)
  • Would it be feasible to only put the alert on pages that (1) may and (2) already have interlanguage links?
    • On special pages with no interlanguage links and on history pages, the interlanguage links list wouldn't be displayed anyway
    • If there's no interlanguage links list, the #p-lang-btn link is misleading
    • Some sister projects collect content that is rarely connected across wikis. It often doesn't make sense to use the alert (meaning, it does sometimes, but relatively more rarely than on Wikipedia)

To summarize why this is in "needs more work":

  • Language message needs gender support
  • Language box is showing up on articles which do not have languages
  • Message incorrectly uses Wikipedia rather than {{SITENAME}}
  • We are lacking a lot of translations (this one is out of our control for now but we may want to reach out to staff to fast-track this)

Change 755745 had a related patch set uploaded (by Clare Ming; author: Clare Ming):

[operations/mediawiki-config@master] Disable language alert for pilot wikis except thwiki, viwiki.

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

Change 755745 merged by jenkins-bot:

[operations/mediawiki-config@master] Disable language alert for pilot wikis except thwiki, viwiki.

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

Mentioned in SAL (#wikimedia-operations) [2022-01-20T19:07:18Z] <cjming@deploy1002> Synchronized wmf-config/InitialiseSettings.php: Config: [[gerrit:755745|Disable language alert for pilot wikis except thwiki, viwiki. (T295555)]] (duration: 00m 51s)

Change 757379 had a related patch set uploaded (by Clare Ming; author: Clare Ming):

[mediawiki/skins/Vector@master] Fix issues with language alert in sidebar:

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

cjming moved this task from Doing to Code Review on the Web-Team-Backlog (Kanbanana-FY-2021-22) board.

Change 757463 had a related patch set uploaded (by Clare Ming; author: Clare Ming):

[mediawiki/core@master] DNM: test config for patchdemo Vector 757379

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

Test wiki created on Patch demo by CMing (WMF) using patch(es) linked to this task:

https://patchdemo.wmflabs.org/wikis/cfcea0c737/w/

Test wiki on Patch demo by CMing (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/cfcea0c737/w/

Test wiki created on Patch demo by CMing (WMF) using patch(es) linked to this task:

https://patchdemo.wmflabs.org/wikis/67c1cb0322/w/

Test wiki on Patch demo by CMing (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/67c1cb0322/w/

Test wiki created on Patch demo by CMing (WMF) using patch(es) linked to this task:

https://patchdemo.wmflabs.org/wikis/77691bf641/w/

cjming moved this task from Doing to Code Review on the Web-Team-Backlog (Kanbanana-FY-2021-22) board.

Change 757379 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Fix issues with language alert in sidebar:

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

Hi, please note that the link in "Go to the top" in articles or pages without other language versions should not be there. It's confusing someone. Thanks

Moving back to needs more work, since the language sidebar box is showing up on https://fr.wikipedia.org/wiki/Projet_de_constitution_fran%C3%A7aise_du_19_avril_1946 per @Patafisik report. This should have been fixed in 1.38.0-wmf.20

Hi, please note that the link in "Go to the top" in articles or pages without other language versions should not be there. It's confusing someone. Thanks

I think you should either do a UX study, or at least have a meeting to discuss this to get consensus, before you decide it "should not be there". It's possible that will be the outcome, but you should at least consider the possibility that it might confuse someone else, if they don't see anything there at all, where they used to see an 'Add link' prompt, perhaps with a short list of popular languages to translate the article into, now they'll see nothing at all? That's a loss of functionality.

What about instead either:

  • keep a message, unlinked, but change the text, to something like. "Normally, on this language version of Wikipedia, the interlanguage links are placed at the top, to the right of the article title. However, this article has no interlanguage links, so there is nothing to display," or similar; or else:
  • keep the message, still linked, largely as is (while maybe adding a teaser about no links for this article) and when you click it, it still goes up to the top where there's a prompt and a link which will jump to Wikidata for adding the new Q-item there, with the proper fields pre-populated.

Maybe there's other possibilities; have a think first.

Next up (@Jdlrobson, @cjming):
Remove language notice from the articles that don't have additional languages

Tt's showing up in the sidebar in more places than desired 😑 - signing this ticket off but hopefully T302018 is resolved shortly

Test wiki on Patch demo by CMing (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/77691bf641/w/

Change 757463 abandoned by Clare Ming:

[mediawiki/core@master] DNM: test config for patchdemo Vector 757379

Reason:

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