跳至內容

「模組:WikidataIB」:修訂間差異

移除 914 位元組 、​ 2023年1月22日 (星期日)
無編輯摘要
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
匿名用戶