Module:Wd: Difference between revisions

Content deleted Content added
Undo revision 21914 by Johnrdorazio (talk)
Tag: Undo
m 1 revision imported
 
(3 intermediate revisions by 3 users not shown)
Line 68:
 
local aliasesP = {
coord = "P5283P625",
-----------------------
image = "P725P18",
author = "P3990P50",
publisher = "P213P123",
importedFrom = "P413P143",
statedIn = "P1408P248",
pages = "P1956P304",
language = "P3001P407",
hasPart = "P4273P527",
publicationDate = "P4788P577",
startTime = "P4821P580",
endTime = "P4841P582",
chapter = "P7048P792",
retrieved = "P7275P813",
referenceURL = "P7714P854",
sectionVerseOrParagraph = "P7839P958",
archiveURL = "P66P1065",
title = "P458P1476",
formatterURL = "P574P1630",
quote = "P622P1683",
shortName = "P739P1813",
definingFormula = "P1463P2534",
archiveDate = "P1873P2960",
inferredFrom = "P2352P3452",
typeOfReference = "P2788P3865",
column = "P2826P3903"
}
 
local aliasesQ = {
percentage = "Q1906Q11229",
prolepticJulianCalendar = "Q13230Q1985786",
citeWeb = "Q13234Q5637226",
citeQ = "Q13236Q22321052"
}
 
Line 653:
function Config:getLabel(id, raw, link, short)
local label = nil
local titleprefix, title= "", nil
local prefix= ""
 
if not id then
Line 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
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
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)
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://enwww.seminaverbiwikidata.bibleget.ioorg/wiki/" .. prefix .. self.entityID .. "?uselang=" .. self.langCode
 
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