Modulo:Controllo Wikidata: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
stessi parametri unit/showunit del template Wikidata, altrimenti creano confusione |
nomi categorie Wikidata ottenuti automaticamente dall'ID della proprietà |
||
Riga 29:
end
local function getCategory(wdval, userval
local comparefunc = function(v1, v2) return v1 == v2 end
local cat
Line 46 ⟶ 45:
if userval then
if not wdval then
cat = string.format('%s assente su Wikidata',
elseif args.uguale ~= 'no' and comparefunc(wdval, userval) then
cat = string.format('%s uguale
elseif args.diff ~= 'no' then
cat = string.format('%s differente
end
elseif wdval then
cat = string.format('%s
end
Line 61 ⟶ 60:
-- Per l'utilizzo da altro modulo
function p._main(args)
local wdprop, userval
local wdval
-- namespace 0
if (mw.title.getCurrentTitle().namespace ~= 0 and args.everyNS ~= 'sì') or
(args.id ~= 'no' and not wdprop)
return nil
end
Line 84 ⟶ 82:
end
return getCategory(wdval, userval
end
|