模組: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 = {
		"綜合元分類",
		{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                             --
--                                                                         --
-----------------------------------------------------------------------------

local function add_manual_param_category(label, desc, addl_intro, include_addl_continuation)
	labels[label] = {
		description = desc or "Pages containing {{{langname}}} " .. label .. ".",
		additional = addl_intro .. (not include_addl_continuation and "" or "\n\n" ..
		"Note that the pages in this category are not necessarily the same as the actual term in question. This " ..
		"frequently happens, for example, with English pages with translation sections, where the term that " ..
		"triggers the addition of the category is one of the translations."),
		parents = {"詞條維護"},
		-- 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

add_manual_param_category("terms in nonstandard scripts", nil,
	"Pages are placed here if they contain terms written in a script that isn't in the language's " ..
	"list of scripts in the language data. This may mean the script should be added to the list, or that the wrong language code has been used.",
	true)

add_manual_param_category("手動轉寫與自動轉寫不同的詞", nil,
	"Pages are placed here if they contain terms whose transliteration has been specified manually using " ..
	"{{para|tr}} or a similar parameter and is different from the transliteration which is automatically generated.",
	true)

add_manual_param_category("有多餘轉寫的詞", nil,
	"Pages are placed here if they contain terms whose transliteration has been specified manually using " ..
	"{{para|tr}} or a similar parameter and is the same as the transliteration which is automatically generated.",
	true)

add_manual_param_category("terms with non-redundant manual script codes", nil,
	"Pages are placed here if they contain terms whose script code has been specified manually using " ..
	"{{para|sc}} or a similar parameter and is different from the script code which is automatically generated.",
	true)

add_manual_param_category("terms with redundant script codes", nil,
	"Pages are placed here if they contain terms whose script code has been specified manually using " ..
	"{{para|sc}} or a similar parameter and is the same as the script code which is automatically generated.",
	true)

add_manual_param_category("terms with non-redundant non-automated sortkeys",
	"{{{langname}}} terms with non-redundant non-automated sortkeys.",
	"Terms are placed here if they have been sorted using a sortkey other than the one which is automatically " ..
	"generated. This can happen for two reasons:\n# A different sortkey has been specified using the {{para|sort}} " ..
	"parameter.\n# One or more categories have been added using raw wikitext, which means the page's default " ..
	"sortkey is used for that category. If that default sortkey is different from the automatic sortkey, then the " ..
	"page will also be added here.")

add_manual_param_category("terms with redundant sortkeys",
	"{{{langname}}} terms with redundant sortkeys.",
	"Terms are placed here if their sortkey has been specified using the {{para|sort}} parameter, and it the same " ..
	"as the one which is automatically generated.")

add_manual_param_category("links with redundant target parameters",
	"Pages containing {{{langname}}} links where the alt text could replace the link target, instead of being given " ..
	"separately.",
	"This occurs when the only difference between the link target and the alt text is that the alt text contains " ..
	"diacritics (or other characters) which would have been ignored anyway had they been included in the link " ..
	"target. For example, {{tl|l|la|amo|amō}} ({{l|la|amo|amō}}) is exactly the same as {{tl|l|la|amō}} " ..
	"({{l|la|amō}}), because macrons are automatically stripped from Latin link targets, even though they're still " ..
	"displayed.")

add_manual_param_category("links with ignored alt parameters",
	"Pages containing {{{langname}}} links where the {{para|alt}} parameter has been ignored.",
	"This occurs when the main linked text includes a wikilink.")

add_manual_param_category("links with redundant alt parameters",
	"Pages containing {{{langname}}} links where the {{para|alt}} parameter is redundant.",
	"This occurs when the alt text makes no difference to the output. For example, {{tl|l|en|foo|foo}} " ..
	"({{l|en|foo|foo}}) is exactly the same as {{tl|l|en|foo}} ({{l|en|foo}}).")

add_manual_param_category("links with ignored id parameters",
	"Pages containing {{{langname}}} links where the {{para|id}} parameter has been ignored.",
	"This occurs when the main linked text includes a wikilink.")

add_manual_param_category("links with redundant wikilinks",
	"Pages containing {{{langname}}} links which contain a redundant wikilink.",
	"This occurs if link target consists of a single wikilink, which should instead be entered in the " ..
	"conventional manner without link brackets. For example, {{tl|l|en|<nowiki>[[foo]]</nowiki>}} " ..
	"is the same as {{tl|l|en|foo}}, and {{tl|l|en|<nowiki>[[foo|bar]]</nowiki>}} is the same as " ..
	"{{tl|l|en|foo|bar}}.\n\nThis also occurs when link templates are nested inside each other " ..
	"unnecessarily: e.g. {{tl|l|en|{{tl|l|en|foo}}}}")

add_manual_param_category("links with manual fragments",
	"Pages containing {{{langname}}} links where a manual link fragment has been given.",
	"This occurs when the link fragment has been specified using {{code|#}} after the term, " ..
	"which overrides the normal fragment generated by link templates that points to the relevant " ..
	"language section.\n\nLink fragments are used to point to a specific section on a target page, and " ..
	"it is preferable to use the {{para|id}} parameter to do this, since it is less likely to break if " ..
	"additional content is added to the target page: for example, the fragment {{code|#Adjective}} " ..
	"will start pointing to the wrong section if another language with an adjective section is added above " ..
	"the intended language.")

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}