Module:ISO 3166: Difference between revisions

add optional "nocat" needed for template:infobox country and use the main data module since it appears to be the same as the sandbox
No edit summary
(add optional "nocat" needed for template:infobox country and use the main data module since it appears to be the same as the sandbox)
Line 7:
local p = {}
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 104:
local eot = args.error or ""
local nocat = (args.nocat and args.nocat == 'true') or nil
if not args[1] then
Line 119 ⟶ 121:
end
end
return nocat and '' or '[[Category:Wikipedia page with obscure country]]'
else --3166-2 code
for alpha2,cdata in pairs(data) do
Line 137 ⟶ 139:
end
if empty then
return nocat and '' or '[[Category:Wikipedia page with obscure subdivision]]'
else
return nocat and '' or '[[Category:Wikipedia page with obscure subdivision]]'
end
end
end
return nocat and '' or '[[Category:Wikipedia page with obscure country]]'
end
Anonymous user