Module:NormalizeModuleName

-- Takes the name of a module, removes any prefixes, and makes it -- case-insensitive.

local function normalize(name) checkType("normalize", 1, name, "string")

-- Split `name` into two parts: -- `prefix` - everything up to and including the first colon -- `root` - everything after `prefix` local prefix, root = name:match("^([^:]+:)(.+)$") prefix = uLower(prefix or "")

-- When loading a module, these prefixes will work: local localNsName = uLower(mw.site.namespaces[828].name) .. ":"   local validPrefixs = { ["dev:"] = true,    -- added by Wikia ["module:"] = true, -- canonical namespace name [localNsName] = true -- namespace name in your language }

-- `name` has no prefix if not validPrefixs[prefix] then prefix = "Module:" root = name end

return lang:ucfirst(prefix) .. lang:ucfirst(root) end