Make it possible to get a label in a given language (probably w/o taking language fallbacks into account) without having to load the whole entity via [[ https://www.mediawiki.org/wiki/Extension:Wikibase_Client/Lua#mw.wikibase.getEntity | mw.wikibase.getEntity]].
Description
Details
Status | Subtype | Assigned | Task | |
---|---|---|---|---|
· · · | ||||
Invalid | None | T112073 Lua in Wikibase (tracking) | ||
Resolved | Jarekt | T173194 Module:Wikidata label should use mw.wikibase.label and mw.wikibase.sitelink | ||
Resolved | Lydia_Pintscher | T90436 Improve usage tracking granularity to avoid irrelevant changes showing in the watchlist. | ||
Resolved | hoo | T173262 Get arbitrary label from Item without loading the full Item (via Lua). | ||
· · · |
Event Timeline
@Jarekt: Would it be ok for your use case if mw.wikibase.label( 'Q123', 'lang' ) were to only return a label if it actually exists in that language, no language fallbacks applied.
This is unlike using mw.wikibase.label( 'Q123' ) which takes fallbacks into account (on multilingual wikis, like commons). Using entity:getLabel also only takes fallbacks into account for the user's language (on multilingual wikis only again), thus this would make mw.wikibase.label( 'Q123', 'lang' ) equivalent to mw.wikibase.getEntity( 'Q123' ):getLabel( 'lang' ).
Yes, That way I can apply the fallback myself. However mw.wikibase.label( 'Q123', 'lang' ) will only be useful if T142903 is also implemented as most labels on Commons have link to Wikipedia in best matching language.
Change 383043 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Wikibase@master] Introduce mw.wikibase.getLabelByLang
Change 383043 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Introduce mw.wikibase.getLabelByLang
Change 383479 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Wikibase@master] Docs: Discourage use of mw.wikibase.getLabelByLang for getting in user lang
Just to add here what I just added to the docs (in https://gerrit.wikimedia.org/r/383479): This function should not be used to get the label in the user's language, as that will bypass T173196.
Change 383479 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Docs: Discourage use of mw.wikibase.getLabelByLang for getting in user lang