Modul:Wd: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
k ~ perbarui kode
Oddstreams (bicara | kontrib)
kTidak ada ringkasan suntingan
 
Baris 653:
function Config:getLabel(id, raw, link, short)
local label = nil
local titleprefix, title= "", nil
local prefix= ""
 
if not id then
Baris 670 ⟶ 669:
if mw.wikibase.isValidEntityId(id) and mw.wikibase.entityExists(id) then
label = id
 
if id:sub(1,1) == "P" then
prefix = "Property:"
end
end
 
prefix, title = "d:Special:EntityPage/", label -- may ..be prefixnil
 
title = label -- may be nil
else
-- try short name first if requested
Baris 691 ⟶ 684:
-- get label
if not label then
label = mw.wikibase.getLabelByLang(id, self.langCode) -- XXX: should use fallback labels?
end
end
Baris 704 ⟶ 697:
elseif id:sub(1,1) == "P" then
-- properties have no sitelink, link to Wikidata instead
prefix, title = "d:Special:EntityPage/", id
prefix = "d:Property:"
end
end
 
label = mw.text.nowiki(label) -- escape raw label text so it cannot be wikitext markup
if title then
label = buildWikilink(prefix .. title, label)