모듈:list description
보이기
이 모듈에 대한 설명문서는 모듈:list description/설명문서에서 만들 수 있습니다
local export = {}
function export.show(frame)
local title = mw.title.getCurrentTitle()
local rootpagename = title.rootText
local isSubpage = title.isSubpage
local subpagename = title.subpageText
mw.log(rootpagename, isSubpage, subpagename)
local lang, canonicalName
if isSubpage then
lang = require("Module:languages").getByCode(subpagename)
end
local listName, matches
if rootpagename then
listName, matches = mw.ustring.gsub(rootpagename, "list:", "")
end
local description
local category = ""
if lang then
if matches == 1 then
description = "This is a list of " .. listName .. " in the " .. lang:getCanonicalName() .. " language."
if mw.ustring.match(listName, "Latin script") then
category = "[[Category:Latin script templates]]"
end
else
description = "This is a list in the " .. lang:getCanonicalName() .. " language."
end
end
if description then
return description .. category
end
end
return export