Lucas_Werkmeister_WMDE added a comment.

Okay, so the way that “added French label” works on Wikidata is that the message wikibase-entity-summary-wbsetlabel-set is locally overridden there, with the following content:

Changed {{#language:$2|{{int:Lang}}}} label

{{#language:}} is a parser function which will render the language code $2 (the part that the original message has in brackets) as a language name in the language {{int:Lang}}. {{int:}} is a parser function that renders the message Lang in the current user language. And finally, Lang is a synthetic interface message in the MediaWiki namespace that has been overridden to return the current language code in each language (e. g. fr, de, be-x-old). Therefore, the message is transformed {{#language:fr|{{int:Lang}}}}{{#language:fr|en}} → “French”.

The {{#language:}} parser function requires the CLDR extension for the list of language names in other languages, otherwise it falls back to displaying the language’s autonym (e. g. «français»), which MediaWiki knows out of the box.

Presumably, the same hack could be made to work on Wikidata for Sense summaries as well, as long as we provide language codes where possible (when only one gloss is affected). But if I’m not mistaken, to make this work out-of-the-box without on-wiki hacks would require a) that we declare a dependency on CLDR (unless we judge that autonyms are no less user friendly than plain language codes?), and b) a parser function to get the current user language (and I assume there are very good reasons why this doesn’t already exist, probably related to cache headaches).

@Lydia_Pintscher: what do you make of this? Is it okay if we produce [en] instead of “English” in the summaries for now, leaving it to the Wikidata community to implement the same hack for Sense messages as well, with the option that perhaps in the future, we’ll clean this up properly, not just for Senses but also for ordinary Wikibase messages?


TASK DETAIL
https://phabricator.wikimedia.org/T196290

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Lydia_Pintscher, WMDE-leszek, RazShuty, Mringgaard, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, Wikidata-bugs, aude, Darkdadaah, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to