Module:Region

local p = {}

function p.region( frame ) local args = frame if frame == mw.getCurrentFrame then args = require( 'Module:ProcessArgs' ).merge( true ) else frame = mw.getCurrentFrame end local Names = mw.loadData('Module:Regionnames') local Styles = require('Module:Regionstyles') local inputlc = mw.ustring.lower(args[1] or '') local style = args[2] or 'rightmedium' local namevars = Names[inputlc]

if not namevars then namevars = {long = "Unrecognized Region", medium = "Unknown", short = "???", adjective = "Unknown" } elseif type(namevars) == 'string' then namevars = Names[namevars] end return Styles[style](namevars) end

return p