Module:StageQuotes

local p = {}

function p.GenerateStageQuotes(frame) local templateargs ={ Qopen='“', Qclose='”', [':']=':',       C='Callie', M='Marie', Ccolor='', Mcolor='', game='Splatoon', language='Eng' }   local parentframeargs = frame:getParent.args local lang = parentframeargs.language or templateargs.language --Get the character names and punctuation per language: local charnames = {'Callie', 'Marie', 'Pearl', 'Marina'} if lang == 'Jap' then charnames = {'アオリ', 'ホタル', 'ヒメ', 'イイダ'} templateargs.Qopen='「' templateargs.Qclose='」' templateargs[':']='：' elseif lang == 'Dut' then charnames = {'Callie', 'Marie', 'Lorelei', 'Mariana'} elseif lang == 'Fre' then charnames = {'Ayo', 'Oly', 'Perle', 'Coralie'} templateargs.Qopen='«' templateargs.Qclose='»' elseif lang == 'Ger' then charnames = {'Aioli', 'Limone', 'Perla', 'Marina'} templateargs.Qopen='„' templateargs.Qclose='“' elseif lang == 'Ita' then charnames = {'Stella', 'Marina', 'Alga', 'Nori'} templateargs.Qopen='«' templateargs.Qclose='»' elseif lang == 'Rus' then charnames = {'Кэлли', 'Мари', 'Жемчик', 'Мариша'} elseif lang == 'Spa' then charnames = {'Mar', 'Tina', 'Perla', 'Marina'} templateargs.Qopen='"'       templateargs.Qclose='"' end --'Eng' is handled by default --Game-specific settings: local game = parentframeargs.game or templateargs.game if game == 'Splatoon 2' then templateargs.Ccolor='' templateargs.Mcolor='' templateargs.C=charnames[3] templateargs.M=charnames[4] else templateargs.C=charnames[1] templateargs.M=charnames[2] end --Use the default only for unspecified parameters: for k,v in pairs(templateargs) do       if parentframeargs[k] ~= nil then templateargs[k] = parentframeargs[k] end end local ret ='' for i=1,16 do       templateargs.Cface = parentframeargs['C'..i..'face'] or '' templateargs.Mface = parentframeargs['M'..i..'face'] or '' --Quote #A if parentframeargs['C'..i..'A'] then templateargs.Cquote = parentframeargs['C'..i..'A'] or '' templateargs.Mquote = parentframeargs['M'..i..'A'] or '' templateargs.CquoteEng = parentframeargs['C'..i..'Aeng'] or '' templateargs.MquoteEng = parentframeargs['M'..i..'Aeng'] or '' templateargs.R = parentframeargs['R'..i..'A'] or '' ret = ret..'|- valign=top\n'..frame:expandTemplate{ title='StageQuote', args = templateargs }..'\n' end --Quote #B if parentframeargs['C'..i..'B'] then templateargs.Cquote = parentframeargs['C'..i..'B'] or '' templateargs.Mquote = parentframeargs['M'..i..'B'] or '' templateargs.CquoteEng = parentframeargs['C'..i..'Beng'] or '' templateargs.MquoteEng = parentframeargs['M'..i..'Beng'] or '' templateargs.R = parentframeargs['R'..i..'B'] or '' ret = ret..'|- valign=top\n'..frame:expandTemplate{ title='StageQuote', args = templateargs }..'\n' end if parentframeargs['Notes'..i] then ret = ret..'|-\n|colspan=3 style="background-color:#EED"|Notes: '..parentframeargs['Notes'..i]..'\n' end end return ret end

return p