Module:category tree/lang/wasc: Difference between revisions

From Linguifex
Jump to navigation Jump to search
No edit summary
Undo revision 520949 by Sware (talk)
 
Line 1: Line 1:
local labels = {}
local handlers = {}
table.insert(handlers, function(data)
table.insert(handlers, function(data)
local suffix, pos = data.label:match("^(%*%S+) (.+)$")
local suffix, pos = data.label:match("^(%*%S+) (.+)$")
Line 19: Line 22:
}
}
end)
end)
return {LABELS = labels, HANDLERS = handlers}

Latest revision as of 11:58, 9 May 2026


This module handles generating the descriptions and categorization for Wascotl category pages of the format "Wascotl LABEL" where LABEL can be any text. Examples are Category:Bulgarian conjugation 2.1 verbs and Category:Russian velar-stem neuter-form nouns. This module is part of the category tree system, which is a general framework for generating the descriptions and categorization of category pages.

For more information, see Module:category tree/lang/documentation.

NOTE: If you add a new language-specific module, you must add the language code to the list at the top of Module:category tree/lang in order for the module to be recognized.


local labels = {}
local handlers = {}

table.insert(handlers, function(data)
	local suffix, pos = data.label:match("^(%*%S+) (.+)$")
	
	if not suffix then
		return nil
	end

	local linksuffix = require("Module:links").full_link({ term = suffix, lang = data.lang }, "term")

	return {
		description = "{{{langname}}} " .. pos .. " derived with " .. linksuffix,
		breadcrumb = require("Module:script utilities").tag_text(suffix, data.lang, data.sc, "term"),
		umbrella = false,
		parents = {{
			name = pos,
			sort = (data.lang:makeSortKey(suffix)),
		}},
		displaytitle = "{{{langname}}} " .. require("Module:script utilities").tag_text(suffix, data.lang, data.sc, "term") .. " " .. pos,
	}
end)

return {LABELS = labels, HANDLERS = handlers}