Jump to content

Module:User:Saph/sandbox

From Wiktionary, the free dictionary


local export = {}

link = require("Module:th").format_link

function export.cls(frame)
	local args = frame:getParent().args
	local result, categories = {}, {}
	local space = '<span style="padding-left:4px; padding-right:4px">&nbsp;</span>'
	for i,l in ipairs(args) do
		table.insert(result, link(l))
		local sortkey = require("Module:languages").getByCode("th"):makeSortKey(result[i])
		table.insert(categories, "\n[[Category:Thai nouns classified by " .. l .. "|" .. sortkey .. "]]")
	end
	return "<span style=\"padding-left:15px; font-size:80%\"><span style=\"background:var(--wikt-palette-cyan, #eaffff);color:inherit\">(''Classifier'': " ..
		table.concat(result, ";" .. space) .. ")</span></span>" .. 
		(mw.title.getCurrentTitle().nsText == "" and table.concat(categories) or "")
end

return export