Module:Main: Difference between revisions

Content deleted Content added
add final fallback to Template:Appeal/default/en
add similar function for Template:Infobox
Line 14:
local p4 = mw.title.new( 'Template:Appeal/default/' .. language )
local p5 = mw.title.new( 'Template:Appeal/default/en' )
 
if p1.exists then
page = p1
elseif p2.exists then
page = p2
elseif p3.exists then
page = p3
elseif p4.exists then
page = p4
else
page = p5
end
 
local expanded = frame:expandTemplate{ title = page, args = frame.args }
return expanded
end
 
function p.get_infobox( frame )
 
local infobox_name = frame.args.infobox
local language = frame.args.language
local country = frame.args.country
 
local p1 = mw.title.new( 'Template:Infobox/' .. infobox_name .. '/' .. language .. '/' .. country )
local p2 = mw.title.new( 'Template:Infobox/' .. infobox_name .. '/' .. language )
local p3 = mw.title.new( 'Template:Infobox/' .. infobox_name .. '/en' )
local p4 = mw.title.new( 'Template:Infobox/Default/' .. language )
local p5 = mw.title.new( 'Template:Infobox/Default/en' )
 
if p1.exists then