模組:Category tree/poscatboiler/data/transliterations

維基詞典,自由的多語言詞典

子頁面


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



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


labels["羅馬化"] = {
	description = "{{{langname}}}詞彙用羅馬字母(拉丁字母)轉寫。",
	parents = {"非詞元形式"},
	umbrella_parents = "轉寫子分類",
	-- 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 = false,
}

labels["沒有主詞條的羅馬化"] = {
	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 = {"詞條維護", {name = "羅馬化", sort = " "}},
	umbrella_parents = "詞條維護子分類",
	--See 'romanizations' above.
	toc_template = {"{{{langcode}}}-rom-categoryTOC", "en-categoryTOC"},
	toc_template_full = {"{{{langcode}}}-rom-categoryTOC/full", "{{{langcode}}}-rom-categoryTOC", "en-categoryTOC/full"},
	catfix = false,
	can_be_empty = true,
	hidden = true,
}

labels["音譯自其他語言的詞條"] = {
	description = "{{{langname}}} terms that have been transliterated from other languages.",
	parents = {{name = "借詞", sort = " "}},
	umbrella_parents = "轉寫子分類",
}



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


raw_categories["轉寫子分類"] = {
	description = "Umbrella categories covering topics related to transliterations.",
	additional = "{{{umbrella_meta_msg}}}",
	parents = {
		"Umbrella metacategories",
		{name = "詞源子分類", sort = " "},
	},
}

raw_categories["手動轉寫與自動轉寫不同的詞"] = {
	intro = "{{also|:Category:使用自動轉寫的語言}}",
	description = "手動轉寫與自動轉寫不同的詞條,按語言分類。",
	hidden = true,
	parents = "Category:模板追蹤",
}

raw_categories["有多餘轉寫的詞"] = {
	intro = "{{also|:Category:使用自動轉寫的語言}}",
	description = "含有多餘轉寫的詞條,按語言分類。",
	hidden = true,
	parents = "Category:模板追蹤",
}

-- raw_categories["Transliteration modules"] = {
-- 	description = "Modules that automatically convert text in one script to another.",
-- 	additional = "Most of them convert non-Latin scripts to Latin (romanisation), and are used by templates or modules to generate transliteration of text that is tagged with a particular language. Each language's transliteration module is specified in its data table (for which, see the category {{catlink|Language data modules}}).",
-- 	parents = {{name = "Modules", sort = "transliteration"}},
-- }



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


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



-----------------------------------------------------------------------------
--                                                                         --
--                                RAW HANDLERS                             --
--                                                                         --
-----------------------------------------------------------------------------


table.insert(raw_handlers, function(data)
	local langcode = data.category:match("^手動轉寫與自動轉寫不同的詞/(.+)$")
	if langcode then
		return {
			description = "手動轉寫與自動轉寫不同的{{{langname}}}詞條。",
			lang = langcode,
			breadcrumb = "{{{langname}}}",
			parents = {
				{ name = "手動轉寫與自動轉寫不同的詞", sort = langcode },
				{ name = "詞條維護", is_label = true, lang = langcode },
			},
			-- Set catfix = false because the page will have a mixture of native-language and
			-- non-native-language pages, but include the normal native-language table of contents headers
			-- because most pages are in the native language.
			catfix = false,
			toc_template = "{{{langcode}}}-categoryTOC",
			toc_template_full = "{{{langcode}}}-categoryTOC/full",
			can_be_empty = true,
			hidden = true,
		}
	end
end)

table.insert(raw_handlers, function(data)
	local langcode = data.category:match("^有多餘轉寫的詞/(.+)$")
	if langcode then
		return {
			description = "有多餘轉寫的{{{langname}}} 詞條。",
			lang = langcode,
			breadcrumb = "{{{langname}}}",
			parents = {
				{ name = "有多餘轉寫的詞", sort = langcode },
				{ name = "詞條維護", is_label = true, lang = langcode },
			},
			-- Set catfix = false because the page will have a mixture of native-language and
			-- non-native-language pages, but include the normal native-language table of contents headers
			-- because most pages are in the native language.
			catfix = false,
			toc_template = "{{{langcode}}}-categoryTOC",
			toc_template_full = "{{{langcode}}}-categoryTOC/full",
			can_be_empty = true,
			hidden = true,
		}
	end
end)

-- table.insert(raw_handlers, function(data)
-- 	local count, languages = data.category:match("^Transliteration modules used by ([0-9]+) (languages?)$")
-- 	if count then
-- 		return {
-- 			description = data.category .. ".",
-- 			breadcrumb = "used by " .. count .. " " .. languages,
-- 			parents = {
-- 				{ name = "Transliteration modules", sort = count },
-- 			},
-- 		}
-- 	end
-- end)

table.insert(handlers, function(data)
	local source_name = data.label:match("^源自(.+)的音譯詞$")
	if source_name then
		local source = require("Module:languages").getByCanonicalName(source_name, true,
			"allow etym langs")
		local source_desc = source:makeCategoryLink()
		return {
			description = "音譯自" .. source_desc .. "{{{langname}}}的詞。",
			breadcrumb = source_name,
			parents = {
				{ name = "音譯自其他語言的詞條", sort = source_name },
				{ name = "源自" .. source_name .. "的借詞", sort = " "},
			},
			umbrella = {
				no_by_language = true,
				parents = {
					{ name = "源自" .. source_name .. "的借詞", is_label = true, sort = " " }
				}
			},
		}
	end
end)


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