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:

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

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 8 2020, 9:30 PM

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