imported>DC |
imported>DC |
第2,506行: |
第2,506行: |
| local label = labelOrId(itemID, lang) | | local label = labelOrId(itemID, lang) |
| return label | | return label |
| end
| |
|
| |
|
| |
| -------------------------------------------------------------------------------
| |
| -- label has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
| |
| -- if no qid is supplied, it uses the qid associated with the current page.
| |
| -- It returns the Wikidata label for the local language as plain text.
| |
| -- If there is no label in the local language, it returns nil.
| |
| -------------------------------------------------------------------------------
| |
| -- Dependencies: none
| |
| -------------------------------------------------------------------------------
| |
| p.label = function(frame)
| |
| local qid = mw.text.trim(frame.args[1] or frame.args.qid or "")
| |
| if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
| |
| if not qid then return end
| |
| local lang = frame.args.lang or ""
| |
| if lang == "" then lang = nil end
| |
| local label, success = labelOrId(qid, lang)
| |
| if success then return label end
| |
| end | | end |
|
| |
|
第3,255行: |
第3,236行: |
| getLink | | getLink |
| getLabel | | getLabel |
| label
| |
| getAT | | getAT |
| getDescription | | getDescription |