Changes

Jump to: navigation, search

Module:Namespace detect/data

95 bytes added, 12:06, 21 March 2014
Undid revision 600634263 by Jackmcbarn (talk): Oh, this seems to have been for performance. Still not sure if it's a good idea, but will leave for now
-- }
--]]
local ustringLower = mw.ustring.lower
local tinsert = table.insert
local subjectNamespaces = mw.site.subjectNamespaces
local talk = cfg.talk
local mappings = {}
mappings[mw.ustring.lowerustringLower(mw.site.subjectNamespaces[0].name)] = {cfg.main} mappings[cfg.talk] = {cfg.talk} for nsid, ns in pairs(mw.site.subjectNamespaces) do
if nsid ~= 0 then -- Exclude main namespace.
local nsname = mw.ustring.lowerustringLower(ns.name) local canonicalName = mw.ustring.lowerustringLower(ns.canonicalName)
mappings[nsname] = {nsname}
if canonicalName ~= nsname then
table.inserttinsert(mappings[nsname], canonicalName)
end
for _, alias in ipairs(ns.aliases) do
table.inserttinsert(mappings[nsname], mw.ustring.lowerustringLower(alias))
end
end
Anonymous user

Navigation menu