Module:Flag

local p = {}

local flag_map = { ["au"] = "Australia", ["be"] = "Belgium", ["br"] = "Brazil", ["ca"] = "Canada", ["cafr"] = "CanadaFrance", ["ch"] = "Switzerland", ["cn"] = "China", ["cu"] = "Cuba", ["cz"] = "CzechRepublic", ["da"] = "Denmark", ["de"] = "Germany", ["gr"] = "Greece", ["es"] = "Spain", ["eu"] = "Europe", ["esmx"] = "SpainMexico", ["fi"] = "Finland", ["fr"] = "France", ["hk"] = "Hong Kong", ["hu"] = "Hungary", ["id"] = "Indonesia", ["ie"] = "Ireland", ["il"] = "Israel", ["in"] = "India", ["it"] = "Italy", ["jp"] = "Japan", ["kp"] = "North Korea", ["mx"] = "Mexico", ["my"] = "Malaysia", ["nl"] = "Netherlands", ["no"] = "Norway", ["ph"] = "Philippines", ["pl"] = "Poland", ["pt"] = "Portugal", ["qc"] = "Quebec", ["ro"] = "Romania", ["ru"] = "Russia", ["se"] = "Sweden", ["sg"] = "Singapore", ["kr"] = "South Korea", ["tw"] = "Taiwan", ["th"] = "Thailand", ["uk"] = "United Kingdom", ["us"] = "USA" }

function p.main(frame) local args = frame:getParent.args local countryCode = args[1] or "" local size = args["size"] or args[2] or "20x20" return p.getFlag(countryCode, size) end

function p.getFlag(countryCode, size) local flagName = flag_map[countryCode] or "" return string.format('',      flagName,      size,      (flagName ~= "" and flagName or "Undisclosed")) end

return p