Page MenuHomePhabricator

Create mw.wikibase.getDescriptionByLang
Open, Needs TriagePublic

Description

It would be useful to be able to use Lua to fetch a description given an input language, without having to fetch and parse the whole item. Ideally, this would also allow an option to use the fallback languages or not.

According to the documentation at:
https://www.mediawiki.org/wiki/Extension:Wikibase_Client/Lua#mw.wikibase.getLabelByLang
we currently have mw.wikibase.getLabelByLang and mw.wikibase.getDescription - but not mw.wikibase.getDescriptionByLang.

For on-wiki discussion, see:
https://www.wikidata.org/w/index.php?title=Wikidata:Project_chat&oldid=999529340#Obtain_a_label_onwiki_in_a_specific_language

Note that the "WithLang" options aren't relevant here, as they just return the defined language, they don't let you select the language to use.

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 20 2019, 9:44 PM

The priority for me would be to have mw.wikibase.getDescriptionByLang with no language fallback (the way that mw.wikibase.getLabelByLang already works). as we already have a request for that functionality.

It would be nice to have the option to switch language fallback on or off, but that's a secondary consideration at present.