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.

Event Timeline

daniel created this task.Jun 3 2015, 5:21 PM
daniel raised the priority of this task from to High.
daniel updated the task description. (Show Details)
Ricordisamoa updated the task description. (Show Details)Jun 3 2015, 6:01 PM
Ricordisamoa set Security to None.
daniel moved this task from incoming to ready to go on the Wikidata board.Jun 10 2015, 4:02 PM
Restricted Application removed a subscriber: Liuxinyu970226. · View Herald TranscriptJul 19 2015, 5:07 PM
Rical removed a subscriber: Rical.Jul 21 2017, 9:36 AM