Modul:category tree/blocks

A Wikiszótárból, a nyitott szótárból

A modult a Modul:category tree/blocks/doc lapon tudod dokumentálni

local export = {}

function export.contents(frame)
	local pagesInCategory = mw.site.stats.pagesInCategory(mw.title.getCurrentTitle().text, "pages")
	local block = mw.ustring.gsub(mw.title.getCurrentTitle().text, " block", "")
	local result = "This category contains entries for characters in the '''[[Appendix:Unicode/" .. block .. "|" .. block .. "]]''' block, as categorized by the character boxes.\n\nSome entries may define characters from multiple Unicode codepoints at once, so the page title could be an entry that is not from this block.[[Category:Unicode blocks]]"

	-- At least 1 page is the appendix for the current Unicode block.
	if pagesInCategory == 1 then
		result = result .. "[[Category:Unicode blocks with 0 entries]]"
	elseif pagesInCategory <= 11 then
		result = result .. "[[Category:Unicode blocks with 1–10 entries]]"
	elseif pagesInCategory <= 51 then
		result = result .. "[[Category:Unicode blocks with 11–50 entries]]"
	elseif pagesInCategory <= 101 then
		result = result .. "[[Category:Unicode blocks with 51–100 entries]]"
	else
		result = result .. "[[Category:Unicode blocks with 101+ entries]]"
	end

	return result
end

return export