Modulo:Codice statistico: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m commento |
m modulo no globals obsoleto |
||
(5 versioni intermedie di un altro utente non mostrate) | |||
Riga 3:
]]--
require('
local getArgs = require('Modulo:Arguments').getArgs
Riga 13:
-- @return {string}
local function formatP964(id)
local formatted_id = string.gsub(id,
return string.format('[http://www.statistik.at/blickgem/gemDetail.do?gemnr=%s %s]', id, formatted_id)
end
Riga 22:
-- @return {string}
local function formatP439(id)
local formatted_id = string.gsub(id,
return string.format('[http://www.statistik-portal.de/Statistik-Portal/gemeindeverz.asp?G=%s %s]', id, formatted_id)
end
Riga 31:
-- @return {string}
local function formatP440(id)
return string.gsub(id,
end
Riga 83:
local statCodes = {
AUT = {
default = { prop = 'P964
},
BEL = {
default = { prop = 'P1567
},
BRA = {
default = { prop = 'P1585
},
CHE = {
default = { prop = 'P771
},
CHN = {
default = { prop = 'P442' }
},
CZE = {
default = { prop = 'P782
},
DEU = {
[
[
default = { prop = 'P439
},
DNK = {
default = { prop = 'P1168
},
ESP = {
default = { prop = 'P772
},
FRA = {
[
[
[
[
default = { prop = 'P374
},
HUN = {
default = { prop = 'P939
},
ITA = {
default = { prop = 'P635
},
NLD = {
default = { prop = 'P382
},
NOR = {
default = { prop = 'P2504
},
UKR = {
default = { prop = 'P1077
}
}
Line 137 ⟶ 140:
-- @param {string} userval
-- @param {string} wdval
-- @param {table} code
-- @return {string}
local function getWikidataCategory(userval, wdval, code)
Line 145 ⟶ 149:
if userval then
if not wdval then
cat = string.format('%s assente su Wikidata', code.
elseif comparefunc(wdval, userval) then
cat = string.format('%s uguale
else
cat = string.format('%s differente
end
elseif wdval then
cat = string.format('%s
end
Line 200 ⟶ 204:
for key, value in pairs(codes) do
if value.prop then
local catLetto = value.
local pagesInCat = mw.site.stats.pagesInCategory(catLetto, 'pages')
tableNode
:tag('tr')
:tag('td')
:wikitext(mw.wikibase.getLabel(value.
:done()
:tag('td')
|