變更
模块:Lan
,已保护“模块:Lan”:高风险模板([编辑=仅管理员](无限期)[移动=仅管理员](无限期))
local l={}
local getArgs
local args
l.fallbackList={
['zh']={'zh','zh-hans','zh-cn','zh-tw','zh-hk','zh-mo','zh-sg'}
,['zh-hans']={'zh-hans','zh-cn','zh-sg','zh'}
,['zh-hant']={'zh-hant','zh-tw','zh-hk','zh-mo','zh'}
,['zh-cn']={'zh-cn','zh-hans','zh-sg','zh'}
,['zh-sg']={'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-hant','zh-hk','zh-tw','zh'}
}
function l.main(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
args = getArgs(frame, {parentFirst=true})
local userlanguage=frame:callParserFunction{ name = 'int', args = {'Conversionname'} }
--mw.message.new('Conversionname'):plain()
local fallback=l.fallbackList[userlanguage]
for _,langArgName in ipairs(fallback) do
if args[langArgName] ~= nil then
return args[langArgName]
end
end
return ''
end
return l
local getArgs
local args
l.fallbackList={
['zh']={'zh','zh-hans','zh-cn','zh-tw','zh-hk','zh-mo','zh-sg'}
,['zh-hans']={'zh-hans','zh-cn','zh-sg','zh'}
,['zh-hant']={'zh-hant','zh-tw','zh-hk','zh-mo','zh'}
,['zh-cn']={'zh-cn','zh-hans','zh-sg','zh'}
,['zh-sg']={'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-hant','zh-hk','zh-tw','zh'}
}
function l.main(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
args = getArgs(frame, {parentFirst=true})
local userlanguage=frame:callParserFunction{ name = 'int', args = {'Conversionname'} }
--mw.message.new('Conversionname'):plain()
local fallback=l.fallbackList[userlanguage]
for _,langArgName in ipairs(fallback) do
if args[langArgName] ~= nil then
return args[langArgName]
end
end
return ''
end
return l