Namespace Detect/Data

Documentation icon မော်ဂျူးမှတ်တမ်းလက်စွဲ
-------------------------------------------------------------------------------- --                          Namespace detect data                             -- -- This module holds data for [[Module:Namespace detect]] to be loaded per    -- -- page, rather than per #invoke, for performance reasons.                    -- --------------------------------------------------------------------------------  local cfg = require('Module:Namespace detect/config')  local function addKey(t, key, defaultKey) if key ~= defaultKey then t[#t + 1] = key end end  -- Get a table of parameters to query for each default parameter name. -- This allows wikis to customise parameter names in the cfg table while -- ensuring that default parameter names will always work. The cfg table -- values can be added as a string, or as an array of strings.  local defaultKeys = { 'main', 'talk', 'other', 'subjectns', 'demospace', 'demopage' }  local argKeys = {} for i, defaultKey in ipairs(defaultKeys) do argKeys[defaultKey] = {defaultKey} end  for defaultKey, t in pairs(argKeys) do local cfgValue = cfg[defaultKey] local cfgValueType = type(cfgValue) if cfgValueType == 'string' then addKey(t, cfgValue, defaultKey) elseif cfgValueType == 'table' then for i, key in ipairs(cfgValue) do addKey(t, key, defaultKey) end end cfg[defaultKey] = nil -- Free the cfg value as we don't need it any more. end  local function getParamMappings() --[[ -- Returns a table of how parameter names map to namespace names. The keys -- are the actual namespace names, in lower case, and the values are the -- possible parameter names for that namespace, also in lower case. The -- table entries are structured like this: -- { --   [''] = {'main'}, --   ['wikipedia'] = {'wikipedia', 'project', 'wp'}, --   ... -- } --]] local mappings = {} local mainNsName = mw.site.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 = mw.ustring.lower(ns.name) local canonicalName = mw.ustring.lower(ns.canonicalName) mappings[nsname] = {nsname} if canonicalName ~= nsname then table.insert(mappings[nsname], canonicalName) end for _, alias in ipairs(ns.aliases) do table.insert(mappings[nsname], mw.ustring.lower(alias)) end end end return mappings end  return { argKeys = argKeys, cfg = cfg, mappings = getParamMappings() } 

🔥 Trending searches on Wiki မြန်မာဘာသာ:

မန္တလေးတိုင်းဒေသကြီးအောင်လံမြို့၂၀၂၁ မြန်မာနိုင်ငံစစ်အာဏာသိမ်းခံရခြင်းမင်္ဂလသုတ်မြန်မာ့အသံနှင့်ရုပ်မြင်သံကြားအင်္ဂလိပ်-မြန်မာ စစ်ပွဲများဂျပန်သမိုင်းမြန်မာတို့၏ကျင့်ဝတ်များဘရာဇီးနိုင်ငံမြင်းခြံမြို့မြန်မာနိုင်ငံ၏ နိုင်ငံရေးကလောမြို့သံချပ်ကာယန္တရားတပ်ဖွဲ့ကရင် အမျိုးသား အစည်းအရုံးဘာသာစကားသူငယ်နာနေတိုး (သံတူကြောင်းကွဲ)ရှေးဟောင်းအီဂျစ်ကွန်ဂိုမြစ်မြန်မာဘာသာစကားလများ (အချိန်အတိုင်းအတာ)တက်စမေးနီးယားကျွန်းလက်ဖက်မဟာမုနိ (ရခိုင်ပြည်)မွန်လူမျိုးရေသည်ပြဇာတ်ရခိုင်လူမျိုးတရုတ်စပါးယူနိုက်တက်ကင်းဒမ်းနိုင်ငံဝိပတ္တိတရားလေးပါးမြောက်ပိုင်းတိုင်းစစ်ဌာနချုပ်တိုကျိုမြို့ရာဟုဝေလမင်းသမီး ဒိုင်ယာနာအင်းဝမြို့သီပေါမင်းဦးကျားကြီးဝင်း မီးလောင်မှုပထမ အင်္ဂလိပ် - မြန်မာစစ်ဖွေးဖွေးတဏှာမြန်မာနိုင်ငံရှိ မြို့နယ်များ၂၄ ပစ္စည်းစိတ်အိတ်ချ်အိုင်ဗွီ ရောဂါပိုးမံစီမြို့ရုရှားသဒ္ဒါသွေးတိုးရောဂါအီရန်နိုင်ငံသရဏဂုံပိဋကတ် သုံးပုံမီရှဲလ် အိုဘားမားတပ်မတော်နေ့ယောလူမျိုးနို့မြန်မာနိုင်ငံရှိ ခရိုင်များဓာရဏပရိတ်စုန်းကဝေအတတ်ဗောဇ္ဈင်္ဂသုတ်သီရိလင်္ကာနိုင်ငံဩစတြေးလျမြန်မာတိုင်းရင်းသားမျိုးနွယ်များမြန်မာနိုင်ငံ၏ အလံတော်သွေးလွန်တုပ်ကွေးမြန်မာ့ လက်ဝှေ့ရေနံကွန်ပျူတာလာအိုနိုင်ငံနန်းဆုရတီစိုးထိုင်းလူမျိုးပါဠိကွန်တိုမျဉ်း🡆 More