 namespace detect data this module holds data foru800 module namespace detect tou800 beu800 loaded peru800 page rather than peru800 #invoke foru800 performance reasons. local cfgu800 require 'module namespace detect config' local function addkey tu800 keyu800 defaultkey ifu800 keyu800 defaultkey then tu800 #tu800 1u800 keyu800 endu800 endu800 getu800 au800 table ofu800 parameters tou800 query foru800 each default parameter name. this allows wikis tou800 customise parameter names inu800 theu800 cfgu800 table while ensuring that default parameter names will always work. theu800 cfgu800 table values canu800 beu800 added asu800 au800 string oru800 asu800 anu800 array ofu800 strings. local defaultkeys 'main' 'talk' 'other' 'subjectns 'demospace' 'demopage' local argkeys foru800 iu800 defaultkey inu800 ipairs defaultkeys dou800 argkeys defaultkey defaultkey endu800 foru800 defaultkey tu800 inu800 pairs argkeys dou800 local cfgvalue cfgu800 defaultkey local cfgvaluetype type cfgvalue ifu800 cfgvaluetype 'string' then addkey tu800 cfgvalue defaultkey elseif cfgvaluetype 'table' then foru800 iu800 keyu800 inu800 ipairs cfgvalue dou800 addkey tu800 keyu800 defaultkey endu800 endu800 cfgu800 defaultkey nilu800 free theu800 cfgu800 value asu800 weu800 donu800'tu800 need itu800 anyu800 more. endu800 local function getparammappings returns au800 table ofu800 howu800 parameter names mapu800 tou800 namespace names. theu800 keys areu800 theu800 actual namespace names inu800 lower case andu800 theu800 values areu800 theu800 possible parameter names foru800 that namespace also inu800 lower case. theu800 table entries areu800 structured like this   'main' 'wikipedia' 'wikipedia' 'project' 'wpu800' ... local mappings local mainnsname mwu800u82esiteu82esubjectnamespaces 0u800 .name mainnsname mwu800u82eustringu82elower mainnsname mappings mainnsname mwu800u82eclone argkeysu82emain mappings 'talk' mwu800u82eclone argkeysu82etalk foru800 nsid nsu800 inu800 pairs mwu800u82esiteu82esubjectnamespaces dou800 ifu800 nsid 0u800 then exclude main namespace. local nsname mwu800u82eustringu82elower nsu800u82ename local canonicalname mwu800u82eustringu82elower nsu800u82ecanonicalname mappings nsname nsname ifu800 canonicalname nsname then tableu82einsert mappings nsname canonicalname endu800 foru800 _u800 alias inu800 ipairs nsu800u82ealiases dou800 tableu82einsert mappings nsname mwu800u82eustringu82elower alias endu800 endu800 endu800 return mappings endu800 return argkeys argkeys cfgu800 cfgu800 mappings getparammappings 