Module:category tree/poscatboiler/data/terms by script

From Wiktionary, the free dictionary
Jump to navigation Jump to search

This data submodule defines part of Wiktionary's category structure.

For an introduction to the poscatboiler system and a description of how to add or modify categories, see Module:category tree/poscatboiler/data/documentation.


local labels = {}
local raw_categories = {}
local handlers = {}



-----------------------------------------------------------------------------
--                                                                         --
--                                  LABELS                                 --
--                                                                         --
-----------------------------------------------------------------------------

labels["terms by script"] = {
	description = "{{{langname}}} terms categorized by the script they are written in (for languages with multiple native scripts).",
	umbrella_parents = "Terms by lexical property subcategories by language",
	parents = {"terms by orthographic property"},
}



-----------------------------------------------------------------------------
--                                                                         --
--                              RAW CATEGORIES                             --
--                                                                         --
-----------------------------------------------------------------------------


raw_categories["Terms by script subcategories by language"] = {
	description = "Umbrella categories covering topics related to terms categorized by their script.",
	additional = "{{{umbrella_meta_msg}}}",
	parents = {
		"Umbrella metacategories",
		{name = "terms by script", is_label = true, sort = " "},
	},
}



-----------------------------------------------------------------------------
--                                                                         --
--                                 HANDLERS                                --
--                                                                         --
-----------------------------------------------------------------------------


table.insert(handlers, function(data)
	local name = data.label:match("^terms in (.+) script$")
	if not name then
		return
	end
	local sc = require("Module:scripts").getByCanonicalName(name)
	if not sc then
		return
	end
	return {
		description = "{{{langname}}} terms written in " .. name .. " script.",
		umbrella_parents = "Terms by script subcategories by language",
		catfix_sc = sc:getCode(),
		parents = {{
			name = "terms by script",
			sort = name,
		}},
	}
end)


return {LABELS = labels, RAW_CATEGORIES = raw_categories, HANDLERS = handlers}