Module:Wd: Difference between revisions
Content deleted Content added
Johnrdorazio (talk | contribs) Undo revision 21914 by Johnrdorazio (talk) Tag: Undo |
Johnrdorazio (talk | contribs) m 1 revision imported |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 68:
local aliasesP = {
coord = "
-----------------------
image = "
author = "
publisher = "
importedFrom = "
statedIn = "
pages = "
language = "
hasPart = "
publicationDate = "
startTime = "
endTime = "
chapter = "
retrieved = "
referenceURL = "
sectionVerseOrParagraph = "
archiveURL = "
title = "
formatterURL = "
quote = "
shortName = "
definingFormula = "
archiveDate = "
inferredFrom = "
typeOfReference = "
column = "
}
local aliasesQ = {
percentage = "
prolepticJulianCalendar = "
citeWeb = "
citeQ = "
}
Line 653:
function Config:getLabel(id, raw, link, short)
local label = nil
local
if not id then
Line 670 ⟶ 669:
if mw.wikibase.isValidEntityId(id) and mw.wikibase.entityExists(id) then
label = id
end
prefix, title = "d:Special:EntityPage/", label -- may
else
-- try short name first if requested
Line 691 ⟶ 684:
-- get label
if not label then
label = mw.wikibase.getLabelByLang(id, self.langCode) -- XXX: should use fallback labels?
end
end
Line 704 ⟶ 697:
elseif id:sub(1,1) == "P" then
-- properties have no sitelink, link to Wikidata instead
prefix, title = "d:Special:EntityPage/", id
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)
Line 740 ⟶ 733:
end
value = "[[File:OOjs UI icon edit-ltr-progressive.svg|frameless|text-top|10px|alt=" .. i18n['info']['edit-on-wikidata'] .. "|link=https://
if self.propertyID then
Line 2,541 ⟶ 2,534:
-- main function that is supposed to be used by wrapper templates
function p.main(frame)
if not mw.wikibase then return nil end
local f, args
|