Page MenuHomePhabricator

Language fallback indicators sometimes still shown for variant fallbacks
Closed, ResolvedPublic

Description

As a Wikidata editor, I don’t want to see language fallback indicators if the fallback is just within language variants, e. g. from British or Canadian English (en-gb, en-ca) to “English” (en).

Problem:
While this generally works (implemented in T174318: Don’t display language fallback indicators for variant fallbacks), language fallback indicators are still sometimes shown. This happens whenever an item is rendered with its label but the main Wikibase stylesheets aren’t loaded (since the hiding of the indicators is implemented in those stylesheets), such as on diff pages (in diff-only mode, i. e. not showing the page below the diff) and on undo pages.

Example:

Note that in the diff case, the presence of item links in the edit summaries seems to be sufficient to “summon” the relevant CSS, so that the indicators are hidden in https://www.wikidata.org/w/index.php?diff=1207519515&uselang=en-gb&diffonly=0.

Screenshots/mockups:
Screenshot_2020-11-08 Difference between revisions of Lexeme L123 - Wikidata.png (663×1 px, 74 KB) Screenshot_2020-11-08 Undoing edit to Q4115189 - Wikidata.png (753×1 px, 78 KB)

BDD
GIVEN a diff between two edits
WHEN viewing the diff
AND using a UI language variant for which there is no label
AND the label exists for the fallback language of that variant
THEN the language indicator is not shown

Acceptance criteria:

  • do not show language indicator on diff pages when we are just falling back from a language variant to its main language

Event Timeline

Note that in the diff case, the presence of item links in the edit summaries seems to be sufficient to “summon” the relevant CSS, so that the indicators are hidden in https://www.wikidata.org/w/index.php?diff=1207519515&uselang=en-gb&diffonly=yes.

Happens in HtmlPageLinkRendererEndHookHandler, I guess. Not sure if there’s a convenient place to similarly add the wikibase.common styles whenever an entity ID is rendered.

Change 639951 had a related patch set uploaded (by Lucas Werkmeister; owner: Lucas Werkmeister):
[mediawiki/extensions/Wikibase@master] Fix missing Wikibase CSS on undo and diff pages

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

Change 639951 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Fix missing Wikibase CSS on undo and diff pages

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

Change 672595 had a related patch set uploaded (by Tobias Andersson; owner: Lucas Werkmeister):
[mediawiki/extensions/Wikibase@REL1_35] Fix missing Wikibase CSS on undo and diff pages

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

Change 672595 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@REL1_35] Fix missing Wikibase CSS on undo and diff pages

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