Modulo:Categoria per anno

Versione del 5 giu 2017 alle 21:24 di Valerio Bozzolan (discussione | contributi) (Valerio Bozzolan ha spostato la pagina Utente:Valerio Bozzolan/Modulo:Categoria per anno a Modulo:Categoria per anno senza lasciare redirect: compila mentalmente: pubblico)

local p = {}

function err(msg) string.format('msg', msg) end

function p._main(args) local s

local mWikidata = require('Modulo:Wikidata') local mString = require('Modulo:String')

local from = args.from local localValue = args.localValue local wikidataProp = args.wikidataProp or 'P571' local wikidataValue = mWikidata._getProperty( { wikidataProp, localValue, from = from } ) local catPart = args.catPart

if ! catPart then return err('richiesto parametro catPart') end

if wikidataValue then -- @TODO mString.match does not work out of a frame local year = mString._match( { s = wikidataValue, pattern = '%d%d%d%d', nomatch = } )

if year and year ~= then s = string.format( , string.format(catPart, year) ) end end

return s end

function p.main(frame) local getArgs = require('Modulo:Arguments').getArgs return p.main( getArgs(frame) ) end

return p