Modul:list description
Penampilan
- Laman modul ini kekurangan sublaman pendokumenan. Sila cipta laman pendokumenan tersebut.
- Pautan berguna: senarai sublaman • pautan • transklusi • kes ujian • kotak pasir
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, "senarai:", "")
end
local description
local category = ""
if lang then
if matches == 1 then
description = "Berikut merupakan senarai " .. listName .. " pada bahasa " .. lang:getCanonicalName() .. "."
if mw.ustring.match(listName, "tulisan Rumi") then
category = "[[Kategori:Templat tulisan Rumi]]"
end
else
description = "Berikut merupakan senarai dalam bahasa " .. lang:getCanonicalName() .. "."
end
end
if description then
return description .. category
end
end
return export