Content deleted Content added
test |
|||
Line 100:
function p.luacode(args)
if
args[1], args[2] = string.match(args[1] or '',"^([^%-]*)%-(.*)$")▼
end▼
▲ if args[1] then args[1] = p.strip(args[1]) end
▲ if args[2] then args[2] = p.strip(args[2]) end
local eot = args.error or ""
Line 119 ⟶ 112:
or '[[Category:Wikipedia page with obscure subdivision]]'
if not
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
if not
for alpha2,cdata in pairs(data) do
if findname(alpha2,cdata,
if args["codetype"]=="numeric" or args["codetype"]=="alpha3" then
return cdata[args["codetype"]]
Line 133 ⟶ 126:
end
end
if string.find(args[1] or '',"%-") then
▲ args[1], args[2] = string.match(args[1] or '',"^([^%-]*)%-(.*)$")
return p.luacode(args)
end
if mw.title.getCurrentTitle().namespace ~= 0 then catnocountry = '' end
Line 138 ⟶ 135:
else --3166-2 code
for alpha2,cdata in pairs(data) do
if findname(alpha2,cdata,
if mw.ustring.match(alpha2,"GB") then -- For England, Wales etc.
alpha2 = "GB"
Line 147 ⟶ 144:
if type(scdata)=="table" then
empty = false
if findname(scode,scdata,
return alpha2.."-"..scode
end
|