Page MenuHomePhabricator

[Task] Consistently and correctly get target or 'cached' language in ParserOptions when userlang option is used
Open, MediumPublic

Description

Parser::getTargetLanguage returns page language (e.g. content language), unless the Parser is parsing an interface message or target language is explicitly set in ParserOptions.

if userlang option is used, then the ParserCache gets split by user language and perhaps/probably target (or something else, parser / cache language?) language should also be set.

If {{int:}} is used on a page, such as on commons, then that does set the target language (afaik) and the cache is split by language.

Having this be consistent and consider userlang would help with having the property parser function and lua be more consistent in what language is used by default to format labels, etc. Right now, the parser function uses target language. If {{#property}} is used on a page with {{int:}} then, the label is in the user language, while lua would be in the content language.

See also T114640: make Parser::getTargetLanguage aware of multilingual wikis

Event Timeline

aude raised the priority of this task from to Needs Triage.
aude updated the task description. (Show Details)
aude added projects: MediaWiki-Parser, Wikidata.
aude added a subscriber: aude.
aude renamed this task from Consistently and correctly get target language in ParserOptions when userlang option is used to Consistently and correctly get target or 'cached' language in ParserOptions when userlang option is used.Aug 20 2015, 12:49 PM
aude updated the task description. (Show Details)
aude set Security to None.

Change 232757 had a related patch set uploaded (by Aude):
Move Parser::setTargetLanguage code logic to ParserOptions

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

Change 232826 had a related patch set uploaded (by Aude):
Set target language in ParserOptions when calling getUserLangObj

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

What is this about? What's the expected behavior? What does it connect to?

aude renamed this task from Consistently and correctly get target or 'cached' language in ParserOptions when userlang option is used to [Story] Consistently and correctly get target or 'cached' language in ParserOptions when userlang option is used.Sep 10 2015, 10:27 AM
aude triaged this task as Medium priority.
aude updated the task description. (Show Details)
aude renamed this task from [Story] Consistently and correctly get target or 'cached' language in ParserOptions when userlang option is used to [Task] Consistently and correctly get target or 'cached' language in ParserOptions when userlang option is used.Sep 15 2015, 10:31 AM

Change 295549 had a related patch set uploaded (by Daniel Kinzler):
[WIP] improve semantics of Parser::getTargetLanguage.

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

Change 232757 abandoned by Aude:
Move Parser::setTargetLanguage code logic to ParserOptions

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

Change 232826 abandoned by Aude:
Set target language in ParserOptions when calling getUserLangObj

Reason:
this is stale

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