Page MenuHomePhabricator

Allow wikibase to render entities for an arbitrary target language, instead of the user's UI language
Open, LowPublic

Description

Wikibase in many cases relies on the uer's UI language as defined by the RequestContext and $wgLang for output generation, via WikibaseRepo::getUserLanguage().

However, when generating ParserOutput, it also uses ParserOptions::getUserLangObject() - which may be different from the current user's language, particularly when rendering "canonical" output. In that case, the output will use one language for some parts of the output, and the other language for others, which cased T199983: Wikidata showing wrong language for page elements.

The immediate solution for that issue was to disallow caching of such inconsistent output, and hope that it's never actually shown to the user.

The correct solution would be to actually use the language passed to EntityParserOutputGeneratorFactory::getEntityParserOutputGenerator() for all output generation. This would require some service interfaces to be changed, particularly ones that have a target language injected into the constructor, like MessageParameterFormatter.

Details

Related Gerrit Patches:

Event Timeline

daniel created this task.Aug 3 2018, 12:21 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 3 2018, 12:21 PM

Change 449780 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/extensions/Wikibase@master] WIP DNM EXP Use parser target language, not user language.

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

Addshore triaged this task as Low priority.Mar 6 2019, 1:10 PM
Addshore added a project: Wikidata-Campsite.
Addshore moved this task from Incoming to Needs Work on the Wikidata-Campsite board.