Modulo:Codice statistico: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
+proprietà
+possibilità di disabilitare un codice
Riga 41:
},
DEU = {
["1"] = {}, -- disabilitato
["3"] = { prop = 'P440', catprefix = 'Codice dei distretti tedesco', format = formatP440 },
default = { prop = 'P439', catprefix = 'Codice municipale tedesco', format = formatP439 }
Line 105 ⟶ 106:
local codes = statCodes[iso3166]
for key, value in pairs(codes) do
if value.prop then
tableNode
:tag('tr')tableNode
:tag('tdtr')
:tag('td')
:wikitext(value.catprefix)
:done()
:tag('td')
:wikitext(iso3166)
:done()
:tag('td')
:wikitext(key == 'default' and 'predefinito' or key)
:done()
:tag('td')
:wikitext(string.format('[[d:p:%s|%s (%s)]]', value.prop, mWikidata._getLabel( { value.prop } ), value.prop))
:done()
end
end
end
Line 132 ⟶ 135:
-- valore utente
userval = args[1]
formatted_userval = userval
 
-- ricerca paese
Line 146 ⟶ 150:
end
 
-- codice presente e abilitato
if code and code.prop then
-- valore letto da Wikidata
wdval = mWikidata._getProperty({ code.prop, from = args.from, n = 1 })