Module:GameShortened

local g = {}

function g.main(frame) local S1 = "S" local S2 = "S2" local S3 = "S3" local OE = "OE" local abbrev = { ['S'] = S,       ['S1'] = S,        ['Splatoon'] = S,        ['Splatoon 1'] = S,        ['S2'] = S2, ['Splatoon 2'] = S2, ['S3'] = S3, ['Splatoon 3'] = S3, ['OE'] = OE, ['Octo Expansion'] = OE, }   -- Calculate the game parameter -- It's the first positional, or in the paramter named 'game' -- If game is not specified, then arg is nil and a default will be used local arg = frame:getParent.args[1] or frame:getParent.args['game'] -- return the abbreviation from the game arg. -- if it's not in the table, instead return the default parameter, which -- is the second positional, or the parameter named 'default', else simply return S1. return abbrev[arg] or frame:getParent.args[2] or frame:getParent.args['default'] or S1 end

return g