Page MenuHomePhabricator

Render labels in the user language on the client (via Lua or parser function), split parser cache
Closed, DuplicatePublic

Description

Currently, the target language for label display is determined in two ways:

  1. PropertyClaimsRendererFactory::newRendererFromParser() uses Parser::getTargetLanguage() which will delegate to Title::getPageLanguage() in the standard case, which in turn will usually return the wiki's content language.
  2. Scribunto_LuaWikibaseEntityLibrary::newImplementation() just uses $wgContLang directly.

This means labels are always rendered in the content language.

For multi-lingual wikis, we can to render labels in the user's language, and split the parser cache accordingly. This should be optional to avoid splitting the parser cache on all wikis.

It's currently unclear how to get the "correct" target language. Conceptually, it seems like Parser::getTargetLanguage() should return the user's language on multi-lingual wikis. It already does this if $this->mOptions->getInterfaceMessage() is not null.

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.