विभाग:Wikidata label/doc

विकिपीडिया, मुक्‍त ज्ञानकोशातून

Documentation[संपादन]

The module provides functions to fetch from wikidata labels, aliases or sitelinks for specific item in specific language. Each function can be called both from Lua and from Wikitext templates. Used by {{Label}} template.

getLabel[संपादन]

This function returns a label translated to desired language and linking to desired project, created based on wikidata

Call from template

{{#invoke:Wikidata label|getLabel |item=<''item ID''> |lang=<''language''> |link=<''link type''> |capitalization=,''capitalization style''> }}

Calls from Lua

require('Module:Wikidata label')._getLabel( item, [lang] , [link_type] , [capitalization] )

Inputs
Name Function Default
item प्रपत्र "Q" + आइटम संख्या में प्र संख्या।
इसके अलावा विकिडाटा के गुणों के साथ भी काम करता है यदि आप कोड "पी" + नंबर का उपयोग करते हैं
(required field)
lang Language code (only needs to be provided if the language displayed is to be fixed and independent of the user’s preferences). {{int:lang}}
link लिंक का प्रकार:
wikipedia विकिपीडिया को लिंक करने का प्रयास करेगा (गुणों के लिए काम नहीं करता है)
विकिडाटा में wikidata
commons कॉमन्स पर (गुणों के लिए काम नहीं करता है)
- का मतलब कोई लिंक नहीं है
कोड पहले आपकी पसंद की लिंक का प्रयास करेगा, यदि यह संभव नहीं है, तो वह वापस आ जाएगी और विकिपीडिया से लिंक करने का प्रयास करेगा, और अगर यह संभव नहीं है, तो विकिडाटा के लिए।
wikipedia
capitalization लिंक का प्रकार:
uc: अपरकेस
lc: लोअर केस
ucfirst: पहले अक्षर के लिए अपरकेस
lcfirst: पहला अक्षर के लिए लोअरकेस
none: इसे छोड़ने के लिए जैसे ही है
none

sitelinks[संपादन]

This function returns a list of sitelinks for a single project organized by language

Call from template

{{#invoke:Wikidata label|sitelinks |item=<''item ID''> |project=<''project''> }}

Calls from Lua

require('Module:Wikidata label')._sitelinks( item, project )

Inputs
Name Function
item Wikidata item ID number in form "Q" + item number or entity class
project "wikipedia" (or "wiki"), "wikisource", "wikiquote", "wikibooks", "wikinews", "wikiversity", "wikivoyage", "wiktionary", etc.
Output
  • for sitelinks a comma separated list
  • for _sitelinks a lua table


aliases[संपादन]

This function returns a list of aliases for a single language

Call from template

{{#invoke:Wikidata label|aliases |item=<''item ID''> |lang=<''language''> }}

Calls from Lua

require('Module:Wikidata label')._aliases( item, lang )

Inputs
Name Function
item Wikidata item ID number in form "Q" + item number or entity class
lang Language code
Output
  • for aliases a comma separated list
  • for _aliases a lua table