Модул:zh-cat
Ин модул мекунад, ки кор ба template:zh-cat
local export = {}
local m_zh = require("Module:zh")
local conventional_names = {
['Beginning'] = 'Beginning Mandarin',
['Elementary'] = 'Elementary Mandarin',
['Intermediate'] = 'Intermediate Mandarin',
['Advanced'] = 'Advanced Mandarin',
['Antonymous'] = 'Chinese antonymous compounds',
['variant'] = 'Chinese variant forms',
['simplified'] = 'Chinese simplified forms',
['obsolete'] = 'Chinese obsolete terms',
}
function export.categorize(frame)
local args = type(frame) == 'table' and frame:getParent().args or { frame }
PAGENAME = PAGENAME or mw.title.getCurrentTitle().text
local id = m_zh.ts_determ(PAGENAME)
sortkey = m_zh.skeys(PAGENAME) .. PAGENAME
local text = ''
for _,cat in ipairs(args) do
if conventional_names[cat] then
text = text .. '[[Category:' .. conventional_names[cat] .. '|' .. sortkey .. ']]'
else
text = text .. "[[Category:zh:" .. cat .. "|" .. sortkey .. "]]"
end
end
return text
end
return export