FANDOM


local Nationality = {}
 
local c = require("Module:Citizenship")
local u = require('Dev:Utility')
local t = nil
 
function Nationality.category( frame )
    local output = ""
 
    local targ = u.getArgs(frame)
 
    local b = tostring(mw.title.getCurrentTitle().text)
 
    t = c.countries
 
    if targ[1] and targ[1] ~= "" then
        local arg = (targ[1] .. "" or "")
        arg = mw.text.trim(arg)
        if t[arg] ~= nil then
            output = t[arg] or ""
        else
            if string.find(arg, "ians") then
                output = mw.ustring.sub(arg, 0, -5)
            else
                output = mw.ustring.sub(arg, 0, -3)
            end
        end
    else
        if t[b] ~= nil then
            output = t[b] or ""
        else
            if string.find(b, "ians") then
                output = mw.ustring.sub(b, 0, -5)
            else
                output = mw.ustring.sub(b, 0, -3)
            end
        end
    end
 
    if output ~= "" then
        output = "[[" .. output .. "]]"
    end
 
    return output
 
end
 
return Nationality

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.