Module:Citizenship

Revision as of 21:55, 2 November 2024 by ESUFranchise (talk | contribs) (Created page with "local p = {} local citizenshipData = mw.loadData('Module:Citizenship/data') local noArgMsg = '<span style="color: #ff0000">No argument provided.</span>' local invalidArgMsg = '<span style="color: #ff0000">Invalid argument provided.</span>' p.citizenship = function(frame) local args = frame:getParent().args if args[1] == nil then return noArgMsg .. 'Category:Pages with script errors' elseif citizenshipData[args[1]] == nil then return invalidArgMsg .. '[[Cate...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This module pulls in from a list of country codes to determine character nationality.


local p = {}

local citizenshipData = mw.loadData('Module:Citizenship/data')

local noArgMsg = '<span style="color: #ff0000">No argument provided.</span>'
local invalidArgMsg = '<span style="color: #ff0000">Invalid argument provided.</span>'

p.citizenship = function(frame)
	local args = frame:getParent().args
	if args[1] == nil then
		return noArgMsg .. '[[Category:Pages with script errors]]'
	elseif citizenshipData[args[1]] == nil then
		return invalidArgMsg .. '[[Category:Pages with script errors]]'
	end
    return citizenshipData[args[1]]
end

return p