首頁
關於我們
隨機
新手使用指南
貢獻分數
百科財務報告
建立新頁面
近期變更
特殊頁面
社群入口
設定
關於微國家百科
免責聲明
微國家百科
搜尋
使用者選單
建立帳號
登入
檢視 模組:Lan2 的原始碼
←
模組:Lan2
由於以下原因,您無權編輯此頁面:
您請求的操作只有這個群組的使用者能使用:
使用者
您可以檢視並複製此頁面的原始碼。
local l = {} local getArgs l.fallbackList = { ['zh'] = {'zh', 'zh-hans', 'zh-hant', 'zh-cn', 'zh-tw', 'zh-hk', 'zh-mo', 'zh-sg', 'zh-my'}, ['zh-hans'] = {'zh-hans', 'zh-cn', 'zh-sg', 'zh-my', 'zh'}, ['zh-hant'] = {'zh-hant','zh-tw', 'zh-hk', 'zh-mo', 'zh'}, ['zh-cn'] = {'zh-cn', 'zh-hans', 'zh-sg', 'zh-my', 'zh'}, ['zh-sg'] = {'zh-sg', 'zh-hans', 'zh-cn', 'zh-my', 'zh'}, ['zh-my'] = {'zh-my', 'zh-hans', 'zh-cn', 'zh-sg', 'zh'}, ['zh-tw'] = {'zh-tw', 'zh-hant', 'zh-hk', 'zh-mo', 'zh'}, ['zh-hk'] = {'zh-hk', 'zh-hant', 'zh-mo', 'zh-tw', 'zh'}, ['zh-mo'] = {'zh-mo', 'zh-hant', 'zh-hk',' zh-tw', 'zh'} } function l.extend (target, ...) local tabs = {...} if not target or not tabs then return target or {} end for i = 1, #tabs do if tabs and type(tabs) == 'table' then for k, v in pairs(tabs[i]) do if type(k) ~= 'number' and v then if type(target[k]) == 'table' and type(v) == 'table' then target[k] = l.extend(target[k], v) else target[k] = v end end end for k, v in ipairs(tabs[i]) do if v then target[#target + 1] = v end end else break end end return target end function l.main(args, lang, fallbackList) local userlanguage = lang and lang:lower() or mw.getCurrentFrame():callParserFunction{ name = 'int', args = {'Conversionname'} } fallbackList = l.extend(l.fallbackList, fallbackList) local fallback = fallbackList[userlanguage] args = args or {} if fallback == nil then fallback = fallbackList['def'] or fallbackList['zh'] or l.fallbackList['zh'] end for _,langArgName in ipairs(fallback) do if args[langArgName] ~= nil then return args[langArgName] end end return '' end return l
此頁面使用了以下模板:
模組:Lan2/doc
(
檢視原始碼
)
返回到「
模組:Lan2
」。