Michael created this task. Michael added a project: wikidata-tech-focus. Restricted Application added a subscriber: Aklapper. Restricted Application added a project: Wikidata.
TASK DESCRIPTION **Background**: In researching T250930: Wikibase receiving ⧼Lang⧽ from uselang parameter and using it everwhere <https://phabricator.wikimedia.org/T250930> (related: T247057 <https://phabricator.wikimedia.org/T247057>) it became clear that our handling of languages is suboptimal. One far-reaching way to tackle that would be to introduce a `TermLanguage` class (and `TermLanguageFactory`) that guarantees to be a valid Term language. However, that would be a very fundamental change of a magnitude that would require an ADR. Further, it seems that most of our problems in that regard seem to stem from "invalid" languages that are provided by our own `\Wikibase\Lib\LanguageFallbackChain`, created by our `\Wikibase\Lib\LanguageFallbackChainFactory`. So it might be possible to improve this situation by taking the following actions: - `\Wikibase\Lib\LanguageFallbackChain` and `\Wikibase\Lib\LanguageFallbackChainFactory` should be renamed `TermLanguageFallbackChain` and `TermLanguageFallbackChainFactory` reduce confusion with MediaWiki's LanguageFallbackChain for interface messages. - The factory should contain validation to ensure that the languages are only valid Term languages. However, that is based on the following assumptions: `\Wikibase\Lib\LanguageFallbackChain` is only used for Terms **It is necessary to investigate whether that assumption is correct and whether the actions above can be taken.** One place, where these fallback chains seem to be used a lot, at least intermittently, is in the \ValueFormatters\FormatterOptions <https://github.com/DataValues/Interfaces/blob/1badbc2b890f862bfb17f16314dbca774c5a1e19/src/ValueFormatters/FormatterOptions.php>. There is an extra investigation to look into how that class is used and maybe can be improved upon: (Looking into JS Term languages is not part of this investigation) TASK DETAIL https://phabricator.wikimedia.org/T256405 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Michael Cc: Tarrow, Addshore, Aklapper, Michael, darthmon_wmde, Nandana, Lahi, Gq86, Pablo-WMDE, GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Scott_WUaS, Wikidata-bugs, aude, Mbch331
_______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs