Module:ISO 3166: Difference between revisions

m
1 revision imported
(fix script errors)
m (1 revision imported)
 
(3 intermediate revisions by 3 users not shown)
Line 35:
--[[----------I S O N A M E----------]]-- -- Find the ISO name of a country/region
 
local function isoname(data,code,lang)
if data[code]["isonames"] then
local name = data[code]["isodisplaynames"] and data[code]["isodisplaynames"][lang]
Line 120:
if not args[1] then
if mw.title.getCurrentTitle().namespace ~= 0 then catnocountry = '' end
return catnocountry, '<span style="font-size:100%" class="error">"No parameter for the country given"</span>'
end
Line 133 ⟶ 134:
end
end
if mw.title.getCurrentTitle().namespace ~= 0 then catnocountry = '' end
return catnocountry
else --3166-2 code
Line 150 ⟶ 152:
end
end
if mw.title.getCurrentTitle().namespace ~= 0 then catnosubdivision = '' end
if empty then
return catnosubdivision
else
return catnosubdivision
end
end
end
if mw.title.getCurrentTitle().namespace ~= 0 then catnocountry = '' end
return catnocountry
end
Line 258:
if region == '' then
region = p.luacode({country, nocat = 'true'})
if mw.title.getCurrentTitle().namespace ~= 0 then catnocountry, catnosubdivision = '', '' end
if region == '' then
tracking = tracking .. catnocountry