Module:CountryData explained

local p = local mostUsed = mw.loadData('Module:CountryData/summary')

local function getcontents(frame,country,params) return frame:expandTemplateend

function p.getcachedtable(frame, country, params) country = mostUsed.redirects[country] or country if params and next(params) then return p.gettable(frame, country, params) end -- Uses mw.loadData to cache data for the most-used templates if mostUsed.pages[country] then local cache = mw.loadData('Module:CountryData/cache' .. mostUsed.pages[country]) if cache.data[country] then return cache.data[country] end end -- if not in cache return p.gettable(frame, country, params)end

function p.gettable(frame,country,params)--Returns the parameters of a country data template as a Lua table --If not a valid data template, return empty table local bool, s = pcall(getcontents,frame,country,params or) if bool and (string.find(s,"^%