Page MenuHomePhabricator

Ranker sometimes inappropriately shows language fallback indicator for language variants
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • On Test Wikidata, set your language to en-gb (convenient link, though you still need to confirm it)
  • load a Ranker batch mode for Test Wikidata, e.g. collective list batch mode
  • edit a statement of an item with an en label but without an en-gb one, e.g. Q180621$95CC15A4-C2E2-4DAD-A5D9-8FAA369FFCF1

What happens?:
The result view shows a language fallback to English:

image.png (157×702 px, 17 KB)


<a title="Q180621" href="https://test.wikidata.org/wiki/Q180621" lang="en">green</a><sup class="wb-language-fallback-indicator wb-language-fallback-variant">&nbsp;English</sup>
(<a href="https://test.wikidata.org/w/index.php?diff=653856">diff</a>)

What should have happened instead?:
No language fallback indicator should be shown, because the target language en-gb is a variant of the fallback language en. The reason is that the stylesheet which hides these fallbacks in Wikidata isn’t loaded in this tool; compare T267502: Language fallback indicators sometimes still shown for variant fallbacks and other tasks listed there.

Software version (skip for WMF-hosted wikis like Wikipedia):
Ranker commit 0e3bf213e8

Event Timeline

Note that Ranker is actually caching the formatted item link between users, because I didn’t realize it depended on the language of the logged-in user; we could force the language to en or use an anonymous session, which would still let us cache the HTML and resolve this issue (because there would be no language fallback anymore), or we could keep the formatting in the user language (it’s nice, I suppose) and split the cache by user (e.g. by putting it in flask.g instead of a cachetools cache).

But I’m mainly using this task as a jumping off point for another task anyway ^^ (edit: now created at T345883)

Change 955965 had a related patch set uploaded (by Lucas Werkmeister; author: Lucas Werkmeister):

[mediawiki/extensions/Wikibase@master] Remove fallback indicator for variant and mul fallbacks

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

Change 955965 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Remove fallback indicator for variant and mul fallbacks

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

Mentioned in SAL (#wikimedia-cloud) [2023-12-03T12:39:42Z] <wm-bot> <lucaswerkmeister> deployed da71d5402e (force English for wbformatvalue+wbformatentities, T345881

LucasWerkmeister claimed this task.

Resolved; I confirmed that the bug is no longer reproducible with the above steps thanks to T345883, and then I also added a change to add uselang=en to API requests anyway, to avoid the other caching issues mentioned in T345881#9151012.