Modulo:Categoria per anno: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m s→ret |
m aggiornato Modulo:Controllo Wikidata, -everyNS +ns |
||
(19 versioni intermedie di un altro utente non mostrate) | |||
Riga 1:
local p = {}
local DEFAULT_PROP = 'P571'
function err(msg)▼
local DEFAULT_CHECK_CAT = 'Data di fondazione o creazione'
local DEFAULT_CHECK_GENRE = 'fs'
▲local function err(msg)
string.format('<span class="error">msg</span>', msg)
end
function p._main(args)
local
args.cat = args[1] or args.cat
end
if not
args.prop = DEFAULT_PROP
▲ return err('richiesto parametro catPart')
end
local value = require('Modulo:Wikidata')._getProperty( {
▲ if wikidataValue then
args.prop,
args.value,
if value then
local year = mw.ustring.match(value, '%d%d%d%d')
▲ } )
▲ if year and year ~= '' then
args.raw and '%s' or '[[Categoria:%s]]',▼
▲ ret = ret .. string.format(
▲ '[[Categoria:%s]]',
▲ string.format(catPart, year)
)
end
end
if not args.raw then
if DEFAULT_PROP == args.prop and not args.checkCat then
args.checkCat = DEFAULT_CHECK_CAT
args.checkGenre = DEFAULT_CHECK_GENRE
end
local check = require('Modulo:Controllo Wikidata')._main( {
args.prop,
args.value,
args.checkCat,
genere = args.checkGenre,
ns = args.ns
} )
if check then
s = s .. check
end
end
return
end
|