模块:Translate:修订间差异
来自Limbo Wiki Mirror
小无编辑摘要 |
小无编辑摘要 |
||
| 第3行: | 第3行: | ||
function p.get(frame) | function p.get(frame) | ||
f = mw.getCurrentFrame(); | f = mw.getCurrentFrame(); | ||
a = ":Config | a = ":Limbo_Wiki:Config/" .. frame.args[1]; | ||
if not(frame.args[2] == frame.args[3]) then | if not(frame.args[2] == frame.args[3]) then | ||
b = a .. "/" .. frame.args[3]; | b = a .. "/" .. frame.args[3]; | ||
2022年3月26日 (六) 12:33的版本
此模块的文档可以在模块:Translate/doc创建
local p = {};
function p.get(frame)
f = mw.getCurrentFrame();
a = ":Limbo_Wiki:Config/" .. frame.args[1];
if not(frame.args[2] == frame.args[3]) then
b = a .. "/" .. frame.args[3];
if (mw.title.new(b,"").exists) then
a = b;
end
b = nil;
end
a = f:expandTemplate{title = a};
return a;
end
function p.single(frame)
a = p.get{args={frame.args[1],frame.args[2],frame.args[3]}};
a = mw.text.split(a,"\n",true);
return a[tonumber(frame.args[4])];
end
return p;
-- =p.get{args={"Date","zh","en"}}
