模組:CWLA
模块文档[创建]
您可能想要创建本Scribunto模块的文档。 编者可以在本模块的沙盒 (编辑 | 差异)和测试样例 (创建)页面进行实验。 请在/doc子页面中添加分类。本模块的子页面。 |
-- For Chinese Wikipedia Library and Archives
local p = {}
local function _loadData(name)
local data = nil
local state
state, data = pcall(mw.loadData, 'Module:CWLA/' .. name)
return data
end
function p.codeName(frame)
local a = frame.args
local d = _loadData('codeDict')
if d.code[a.code] ~= nil then
if (a.origin == '1') then
return d.code[a.code].title
elseif (a.origin == '0' and a.lan == 'hans') then
return d.code[a.code].s_title
elseif (a.origin == '0' and a.lan == 'hant') then
return d.code[a.code].t_title
end
end
end
return p