Content deleted Content added
sync |
only specify category names once, never use category names outside of article namespace |
||
Line 8:
local getArgs = require("Module:Arguments").getArgs
local data = mw.loadData("Module:ISO 3166/data/National/sandbox")
--[[----------F I N D N A M E----------]]-- -- Finds the name in the database
Line 113 ⟶ 115:
local catnocountry = (args.nocat and args.nocat == 'true') and ''
or cats.nocountry
▲ or '[[Category:Wikipedia page with obscure country]]'
local catnosubdivision = (args.nocat and args.nocat == 'true') and ''
or cats.nosubdivision
▲ or '[[Category:Wikipedia articles with obscure subdivision]]'
if (code1 or "") == "" then
Line 136 ⟶ 138:
if args[2] then return p.luacode(args) end
end
else --3166-2 code
for alpha2,cdata in pairs(data) do
Line 159 ⟶ 160:
return p.luacode(args)
end
end
end
Line 167:
return p.luacode(args)
end
end
Line 200 ⟶ 199:
local code2 = ''
local catnocountry = (args.nocat and args.nocat == 'true') and ''
or cats.nocountry
if string.find(code1,"%-") then
code1, code2 = string.match(code1,"^([^%-]*)%-(.*)$")
Line 210 ⟶ 212:
or (data[code1]["displayname"] or data[code1]["name"])
else
return (mw.title.getCurrentTitle().namespace == 0) and catnocountry or ''
end
else --3166-2 code
Line 217 ⟶ 219:
sdata = mw.loadData("Module:ISO 3166/data/"..code1)
else
return (mw.title.getCurrentTitle().namespace == 0) and catnocountry or ''
end
if sdata[code2] then
Line 223 ⟶ 225:
or (sdata[code2]["displayname"] or sdata[code2]["name"])
else
return (mw.title.getCurrentTitle().namespace == 0) and catnocountry or ''
end
end
Line 247 ⟶ 249:
local subdivisionqueried = false
local catnocountry = (args.nocat and args.nocat == 'true') and ''
or cats.nocountry
local catnosubdivision = (args.nocat and args.nocat == 'true') and ''
or cats.nosubdivision
local tracking = ''
local targs = {}
|