Module:Sandbox: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
escape special character |
No edit summary |
||
Line 22: | Line 22: | ||
end |
end |
||
local expanded = frame:expandTemplate{ title = page, args = |
local expanded = frame:expandTemplate{ title = page, args = frame.args } |
||
return expanded |
return expanded |
Revision as of 20:12, 5 March 2019
Documentation for this module may be created at Module:Sandbox/doc
local p = {} -- p stands for package
function p.get_appeal( frame )
local appeal_name = string.gsub( frame.args.appeal , 'Appeal%-', '' )
local language = frame.args.language
local country = frame.args.country
local p1 = mw.title.new( 'Template:Appeal/' .. appeal_name .. '/' .. language .. '/' .. country )
local p2 = mw.title.new( 'Template:Appeal/' .. appeal_name .. '/' .. language )
local p3 = mw.title.new( 'Template:Appeal/' .. appeal_name .. '/en' )
local p4 = mw.title.new( 'Template:Appeal/default/' .. language )
if p1.exists then
page = p1
elseif p2.exists then
page = p2
elseif p3.exists then
page = p3
else
page = p4
end
local expanded = frame:expandTemplate{ title = page, args = frame.args }
return expanded
end
return p