打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

模块:En:修订间差异

来自末世录
OnlyOTO留言 | 贡献
导入1个版本
OnlyOTO留言 | 贡献
无编辑摘要
 
第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