Module:Sandbox/Nathan fraignt/Names explained

local p =

local dutchWordsArray = local dutchWordsArray_idx = for i,v in ipairs(dutchWordsArray) do dutchWordsArray_idx[v] = i end

local spanishAccentsArray = local spanishAccentsArray_idx = for i,v in ipairs(spanishAccentsArray) do spanishAccentsArray_idx[v] = i end

-- This is by no means a complete list.local chineseNamesArray = local chineseNamesArray_idx = for i,v in ipairs(chineseNamesArray) do chineseNamesArray_idx[v] = i end

-- es, nl, zh, us

p.getNames = function(frame) local getFormat = function(nf_name) -- Spanje local test = "" for letter in string.gmatch(nf_name, "%a") do if spanishAccentsArray_idx[letter] then return "es" end -- test = test .. "-" .. letter test = test .. letter end -- Dutch for word in string.gmatch(nf_name, "%w+") do if dutchWordsArray_idx[word] then return "nl" end end -- Chinese for word in string.gmatch(nf_name, "%w+") do if chineseNamesArray_idx[word] then return "zh" end end -- Default: US return test end local nf_name = frame.args.name or "" local format = frame.args.format or getFormat(nf_name) return format endreturn p