模块:En:修订间差异
来自末世录
更多操作
小 导入1个版本 |
无编辑摘要 |
||
| 第2行: | 第2行: | ||
local wikipedia = "https://en.wikipedia.org/wiki/" | local wikipedia = "https://en.wikipedia.org/wiki/" | ||
local noLang = false | local noLang = false | ||
local function genEn(frame) | local function genEn(frame) | ||
local enPage = frame.args[1] | local enPage = frame.args[1] | ||
| 第24行: | 第24行: | ||
return res | return res | ||
end | end | ||
function p.en(frame) | function p.en(frame) | ||
return genEn(frame) | return genEn(frame) | ||
end | end | ||
function p.enNoLang(frame) | function p.enNoLang(frame) | ||
noLang = true | noLang = true | ||
return genEn(frame) | return genEn(frame) | ||
end | end | ||
return p | return p | ||
2026年3月28日 (六) 01:19的最新版本
此模块的文档可以在模块:En/doc创建
local p = {}
local wikipedia = "https://en.wikipedia.org/wiki/"
local noLang = false
local function genEn(frame)
local enPage = frame.args[1]
if enPage ~= nil then
enPage = enPage:gsub(" ", "_")
else
enPage = ""
end
local display = frame.args[2]
if display ~= nil and display ~= "" then
display = display:gsub("_", " ")
else
display = enPage:gsub("_", " ")
end
local title = mw.title.getCurrentTitle()
local res = "([" .. wikipedia .. enPage .. " " .. display .. "])"
-- end
if noLang ~= true then
res = res .. "[[en:" .. enPage:gsub("_", " ") .. "]]"
end
return res
end
function p.en(frame)
return genEn(frame)
end
function p.enNoLang(frame)
noLang = true
return genEn(frame)
end
return p