Changes

Jump to: navigation, search

Module:Namespace detect/data

47 bytes added, 10:02, 5 April 2014
bug fix - use the demospace parameter as both key and value in the argKeys table
-- values can be added as a string, or as an array of strings.
local argKeys defaultKeys = { main = {'main'}, talk = {'talk'}, other = {'other'}, subjectns = {'subjectns'}, demospace = {'demospace'}, page = {'pagedemopage'}
}
 
local argKeys = {}
for i, defaultKey in ipairs(defaultKeys) do
argKeys[defaultKey] = {defaultKey}
end
for defaultKey, t in pairs(argKeys) do
for nsid, ns in pairs(mw.site.subjectNamespaces) do
if nsid ~= 0 then -- Exclude main namespace.
local nsname = mw.ustring.lower(ns.name) local canonicalName = mw.ustring.lower(ns.canonicalName) mappings[nsname] = {mw.ustring.lower(nsname)}
if canonicalName ~= nsname then
table.insert(mappings[nsname], mw.ustring.lower(canonicalName))
end
for _, alias in ipairs(ns.aliases) do
Anonymous user

Navigation menu