Content deleted Content added
|
|
-- TODO: Refactor this and others, could just build an array of titles and then pass to
-- another function to do fallback
function p.get_tax_message_newget_tax_message( frame )
local tax_message = frame.args.tax_message
return expanded
end
function p.get_tax_message( frame )
local tax_message = frame.args.tax_message
local language = frame.args.language
local country = frame.args.country
if ( tax_message == '' and country == 'FR' ) then
tax_message = 'FR'
end
if ( tax_message == '' and country == 'ES' ) then
tax_message = 'ES'
end
local p1 = mw.title.new( 'Template:Tax/' .. tax_message .. '/' .. language )
local p2 = mw.title.new( 'Template:Tax/LinkOnly' )
if p1.exists then
page = p1
else
page = p2
end
local expanded = frame:expandTemplate{ title = page, args = frame.args }
return expanded
end
|