Changes

Jump to: navigation, search

Module:Namespace detect/data

42 bytes added, 03:37, 24 March 2014
Undid revision 601018314 by Mr. Stradivarius (talk) looks like that broke something
-- }
--]]
local ustringLower = mw.ustring.lower
local tinsert = table.insert
local clone = mw.clone
local subjectNamespaces = mw.site.subjectNamespaces
local mappings = {}
local mainNsName = mw.site.mappings[ustringLower(subjectNamespaces[0].name mainNsName = mw.ustring.lower(mainNsName) mappings[mainNsName] = mw.clone(argKeys.main) mappings['talk'] = mw.clone(argKeys.talk) for nsid, ns in pairs(mw.site.subjectNamespaces) do
if nsid ~= 0 then -- Exclude main namespace.
local nsname = ustringLower(ns.name) local canonicalName = ustringLower(ns.canonicalName) mappings[nsname] = {mw.ustring.lower(nsname)}
if canonicalName ~= nsname then
table.inserttinsert(mappings[nsname], mw.ustring.lower(canonicalName))
end
for _, alias in ipairs(ns.aliases) do
table.inserttinsert(mappings[nsname], mw.ustring.lowerustringLower(alias))
end
end
Anonymous user

Navigation menu