local p =
local getArgs
local countries = do do -- United States local states = for i,v in ipairs(states) do countries[v] = "USA" end end -- United States do -- Canada local provinces = for i,v in ipairs(provinces) do countries[v] = "CAN" end end -- Canada do -- Mexico local states = for i,v in ipairs(states) do countries[v] = "MEX" end end -- Mexico do -- Australia local states = for i,v in ipairs(states) do countries[v] = "AUS" end end -- Australiaend
p.mapping = countries
function p._country(state, country) return country and string.upper(country) or countries[state]end
function p.country(frame) if not getArgs then getArgs = require('Module:Arguments').getArgs end local args = getArgs(frame) return p._country(args[1], args[2])end
return p