Module:Lan:修订间差异
外观
Qiuwen>待春 小 导入1个版本:导入自此网站的同名页面[页面文字原许可:CC BY-SA 4.0;作者请参见来源页面历史] |
zhwiki>Ericliu1912 依據編輯請求更新頁面 調整格式、排版 |
||
| 第4行: | 第4行: | ||
local args | local args | ||
l.fallbackList={ | l.fallbackList={ | ||
['zh']={'zh','zh-hans','zh-hant','zh-cn','zh-tw','zh-hk','zh-mo','zh-sg','zh-my'} | ['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-sg', 'zh-hans', 'zh-cn', '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-hk', 'zh-hant',' zh-tw', 'zh'} | |||
} | } | ||
2026年7月17日 (五) 05:56的版本
此模块的文档可以在Module:Lan/doc创建
local l={}
local getArgs
local args
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-sg', 'zh-hans', 'zh-cn', '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-hk', 'zh-hant',' zh-tw', 'zh'}
}
function l._main(args, frame)
local userlanguage=frame:callParserFunction{ name = 'int', args = {'Conversionname'} }
--mw.message.new('Conversionname'):plain()
local fallback=l.fallbackList[userlanguage]
if fallback == nil then
fallback=l.fallbackList['zh']
end
for _,langArgName in ipairs(fallback) do
if args[langArgName] ~= nil then
return args[langArgName]
end
end
return ''
end
function l.main(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
args = getArgs(frame, {parentFirst=true})
return l._main(args, frame)
end
return l