Module:NationNamer: Difference between revisions

From Terra Invicta Official Wiki
Llamageddon (talk | contribs)
Seeing if leaving redirect format to template at least works
Llamageddon (talk | contribs)
mNo edit summary
Line 20: Line 20:


function p.Test(frame)
function p.Test(frame)
local testName = frame.args[1]
return '#REDIRECT [[ACE]]'
return '#REDIRECT [[' .. testName .. ']]'
end
end


return p
return p

Revision as of 00:25, 5 December 2025

Documentation for this module may be created at Module:NationNamer/doc

-- For now this is just used by the NationDataNameRedirect template to convert nation displayNames to dataNames
-- Another LUA module to avoid 100+ switch templates

local p = {}

local nationData = mw.loadData( 'Module:NationNamer/dataNames' )

function p.Redirect( frame )
	local nationName = frame.args[1]
	if not nationName then
		return 'No such nation name'	
	end
	if not nationData[nationName] then
		return 'No such nation name'	
	end
	
	-- iconData[iconName][1] is the nation dataName (country code).
	return nationData[nationName][1]
end

function p.Test(frame)
	return '#REDIRECT [[ACE]]'
end

return p