⚓ T173262 Get arbitrary label from Item without loading the full Item (via Lua).


Article Images

Get arbitrary label from Item without loading the full Item (via Lua).

Event Timeline

hoo added a comment.EditedAug 15 2017, 8:32 AM

@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' ).

@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.

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.

Content licensed under Creative Commons Attribution-ShareAlike (CC BY-SA) 4.0 unless otherwise noted; code licensed under GNU General Public License (GPL) 2.0 or later and other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct. · Wikimedia Foundation · Privacy Policy · Code of Conduct · Terms of Use · Disclaimer · CC-BY-SA · GPL · Credits