Module:category tree/transliterations


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

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


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



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


labels["romanizations"] = {
	description = "{{{langname}}} terms transliterated into the Latin alphabet.",
	parents = {"non-lemma forms"},
	umbrella_parents = "Transliterations subcategories by language",
	-- Special romanization-specific table-of-contents bars are used on romanization pages
	-- (e.g. [[Template:got-rom-categoryTOC]]) because they hold Latin-script terms in a
	-- language-specific romanization scheme, rather than terms in the language's normal script.
	-- For the same reason, we specify catfix = false to disable script-specific font
	-- formatting.
	toc_template = {"{{{langcode}}}-rom-categoryTOC", "en-categoryTOC"},
	toc_template_full = {"{{{langcode}}}-rom-categoryTOC/full", "{{{langcode}}}-rom-categoryTOC", "en-categoryTOC/full"},
	catfix_sc = "Latn",
}

labels["romanizations without a main entry"] = {
	description = "{{{langname}}} romanizations where the corresponding entry in the language's normal script does not exist. Automatically added by <code>{{[[Template:romanization of|romanization of]]}}</code> when applicable.",
	parents = {"entry maintenance", {name = "romanizations", sort = " "}},
	umbrella_parents = "Entry maintenance subcategories by language",
	--See 'romanizations' above.
	toc_template = {"{{{langcode}}}-rom-categoryTOC", "en-categoryTOC"},
	toc_template_full = {"{{{langcode}}}-rom-categoryTOC/full", "{{{langcode}}}-rom-categoryTOC", "en-categoryTOC/full"},
	catfix_sc = "Latn",
	can_be_empty = true,
	hidden = true,
}

labels["terms transliterated from other languages"] = {
	description = "{{{langname}}} terms that have been transliterated from other languages.",
	parents = {{name = "borrowed terms", sort = " "}},
	umbrella_parents = "Transliterations subcategories by language",
}

labels["arabicizations"] = {
	description = "{{{langname}}} terms transliterated into the Arabic abjad.",
	parents = {"non-lemma forms"},
	umbrella_parents = "Transliterations subcategories by language",
	-- Special romanization-specific table-of-contents bars are used on romanization pages
	-- (e.g. [[Template:got-arab-categoryTOC]]) because they hold Latin-script terms in a
	-- language-specific romanization scheme, rather than terms in the language's normal script.
	-- For the same reason, we specify catfix = false to disable script-specific font
	-- formatting.
	toc_template = {"{{{langcode}}}-arab-categoryTOC", "en-categoryTOC"},
	toc_template_full = {"{{{langcode}}}-arab-categoryTOC/full", "{{{langcode}}}-arab-categoryTOC", "en-categoryTOC/full"},
	catfix_sc = "Arab",
}

labels["arabicizations without a main entry"] = {
	description = "{{{langname}}} arabicization where the corresponding entry in the language's normal script does not exist. Automatically added by <code>{{[[Template:arabicization of|arabicization of]]}}</code> when applicable.",
	parents = {"entry maintenance", {name = "arabicizations", sort = " "}},
	umbrella_parents = "Entry maintenance subcategories by language",
	--See 'romanizations' above.
	toc_template = {"{{{langcode}}}-arab-categoryTOC", "en-categoryTOC"},
	toc_template_full = {"{{{langcode}}}-arab-categoryTOC/full", "{{{langcode}}}-arab-categoryTOC", "en-categoryTOC/full"},
	catfix_sc = "Arab",
	can_be_empty = true,
	hidden = true,
}

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


raw_categories["Transliterations subcategories by language"] = {
	description = "Umbrella categories covering topics related to transliterations.",
	additional = "{{{umbrella_meta_msg}}}",
	parents = {
		"Umbrella metacategories",
		{name = "Terms by etymology subcategories by language", sort = " "},
	},
}



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


table.insert(handlers, function(data)
	local source_name = data.label:match("^transliterations of (.+) terms$")
	if not source_name then
		return
	end
	local source = require("Module:languages").getByCanonicalName(source_name, true, true, true)
	if source_name ~= source:getCanonicalName() then
		return
	end
	local display_form = source:getDisplayForm()
	local source_desc = source:makeCategoryLink()
	return {
		description = "{{{langname}}} terms that have been transliterated from " .. source_desc .. ".",
		breadcrumb = display_form,
		parents = {
			{ name = "terms transliterated from other languages", sort = display_form },
			{ name = "terms borrowed from " .. display_form, sort = " "},
		},
		umbrella = {
			no_by_language = true,
			parents = {
				{ name = "terms borrowed from " .. display_form, is_label = true, sort = " " }
			}
		},
	}
end)


return {LABELS = labels, RAW_CATEGORIES = raw_categories, HANDLERS = handlers}
Category:Category tree data modules