Page MenuHomePhabricator

WikibaseLexeme: Remove calls to WikibaseRepo::getUserLanguage from formatter factory callbacks
Open, Needs TriagePublic

Description

Currently, the formatter-factory-callback functions in WikibaseLexeme.datatypes.php call the deprecated UserLanguage service from WikibaseRepo. In order to retire this service, we will need to find a way to obtain the language in a more appropriate way, either via RequestConext or by making using the globals directly rather than through Wikibase.

Event Timeline

We should probably get the language to use from the given FormatterOptions, and expect those options to contain ValueFormatter::OPT_LANG or FormatterLabelDescriptionLookupFactory::OPT_LANGUAGE_FALLBACK_CHAIN, like we did for T281726: Stop injecting LanguageNameLookup into WikibaseValueFormatterBuilders. (Perhaps we could turn WikibaseValueFormatterBuilders::newLanguageNameLookup() into LanguageNameLookupFactory::newForFormatterOptions()? Not sure if that makes sense.)