Modulo:Sandbox/Laurentius: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
indici
Nessun oggetto della modifica
Riga 39:
end
return t
end
 
-- se il monumento ha una categoria associata, usarestituisce quella. Altrimenti, quella del comune.
-- Altrimenti, quella del comune.
local iffunction main_category then(qid)
local main_categorycategory = mWikidata._getProperty({'P373', from = qid, snaktype = 'value'})
if category then
return category
else
local municipality_category =return mWikidata._getProperty({'P131', from = qid, showprop = 'P373', snaktype = 'value'})
end
end
 
Riga 46 ⟶ 57:
 
local categories = {}
local lake_como = false
 
-- categoria principale
-- se il monumento ha una categoria associata, usa quella. Altrimenti, quella del comune.
table.insert(categories, main_category(qid))
local main_category = mWikidata._getProperty({'P373', from = qid, snaktype = 'value'})
if main_category then
table.insert(categories, main_category)
else
local municipality_category = mWikidata._getProperty({'P131', from = qid, showprop = 'P373', snaktype = 'value'})
table.insert(categories, municipality_category)
end
 
-- alberi monumentali
Riga 60 ⟶ 66:
table.insert(categories, 'Images from Wiki Loves Monuments 2019 in Italy - veteran trees')
end
 
-- Wiki Loves Lake Como
local provincia = tp[4]
if provincia == 'Provincia di Como' or provincia == 'Provincia di Lecco' then
table.insert(categories, 'Images from Wiki Loves Monuments 2019 in Italy - Lake Como')
lake_como = true
end
 
-- foto per regione
Riga 66 ⟶ 79:
if regioni[regione] then
table.insert(categories, 'Images from Wiki Loves Monuments 2019 in Italy - ' .. regioni[regione][1])
if not regioni[regione][2] and not lake_como then
table.insert(categories, 'Images from Wiki Loves Monuments 2019 in Italy - without regional award')
end
else
table.insert(categories, 'Images from Wiki Loves Monuments 2019 in Italy - unknown region')
end
 
-- Wiki Loves Lake Como
local provincia = tp[4]
if provincia == 'Provincia di Como' or provincia == 'Provincia di Lecco' then
table.insert(categories, 'Images from Wiki Loves Monuments 2019 in Italy - Lake Como')
end