From Simple English Wikipedia, the free encyclopedia
This module is rated as beta, and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected.
This module depends on the following other modules:
Lua-native alternative to popular flag templates. Can be used to reduce post-expand include size of pages with lots of templates, since it avoids calling multilevel templates.
localp={}functionp._main(frame,name,mode,check)localcategories={Flagicon='[[Category:Flagicons with missing country data templates]]',Flagdeco='[[Category:Flagdeco with missing country data templates]]',}localargs={}ifrequire('Module:Yesno')(frame.args['getParent'])thenfork,vinpairs(frame:getParent().args)doif(vor'')~=''thenargs[k]=vendendendfork,vinpairs(frame.args)doif(vor'')~=''thenargs[k]=vendendifname=='Flag+link'thenargs['pref']=args[1]elseargs['variant']=args[2]orargs['variant']args[2]=args[1]endargs[1]=mode..(args['opts']andargs['opts']or'')args['missingcategory']=categories[name]or''args['noredlink']=args['noredlink']or'no'ifrequire('Module:Yesno')(args['placeholder'])~=truethenargs[1]=args[1]..'o'endifcheckthenlocalopts={unknown=frame:expandTemplate{title='main other',args={'[[Category:Pages using '..mw.ustring.lower(name)..' template with unknown parameters|_VALUE_'..frame:getParent():getTitle()..']]'}},preview='Page using [[Template:'..name..']] with unknown parameter "_VALUE_"',ignoreblank='y',[1]='1',[2]='2',[3]='variant',[4]='image',[5]='size',[6]='sz',[7]='border',[8]='align',[9]='al',[10]='width',[11]='w',[12]='alt',[13]='ilink',[14]='noredlink',[15]='missingcategory',[16]='name',[17]='clink',[18]='link',[19]='pref',[20]='suff',[21]='plink',[22]='the',[23]='section',[24]='altvar',[25]='avar',[26]='age',[27]='nalign',[28]='nal',[29]='text',[30]='nodata',[31]='opts',[32]='placeholder',[33]='getParent'}check=require('Module:Check for unknown parameters')._check(opts,args)elsecheck=''endreturnrequire('Module:Flagg').luaMain(frame,args)..checkendfunctionp.main(frame)returnp._main(frame,'Flag','uncb',false)endp['flag']=p.mainfunctionp.deco(frame)returnp._main(frame,'Flagdeco','uxx',false)endp['flagdeco']=p.decofunctionp.icon(frame)returnp._main(frame,'Flagicon','cxxl',true)endp['flagicon']=p.iconfunctionp.pluslink(frame)returnp._main(frame,'Flag+link','unpof',false)endp['+link']=p.pluslinkp['flag+link']=p.pluslinkfunctionp.country(frame)returnp._main(frame,'Flagcountry','unce',false)endp['flagcountry']=p.countryreturnp