跳转到内容

模組:Category tree/poscatboiler/data/wiktionary maintenance

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

此數據子模塊定義了維基詞典分類結構的一部分。

關於poscatboiler系統的介紹以及如何添加或更改分類,請參見Module:category tree/poscatboiler/data/documentation


local raw_categories = {}
local raw_handlers = {}

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

raw_categories["維基詞典維護"] = {
	description = "Categories containing pages that are being tracked for attention and improvement by editors.",
	breadcrumb = "維護",
	parents = "維基詞典",
}

raw_categories["使用精簡模板的頁面"] = {
	description = "至少使用一個精簡模板的頁面。",
	additional = "參見[[:Category:無lua模板]].",
	breadcrumb = "使用精簡模板",
	parents = {"維基詞典維護"},
	can_be_empty = true,
	hidden = true,
}

raw_categories["帶有製表字元的頁面"] = {
	description = "Wikitext 中包含製表字元的頁面。",
	additional = "這些頁面中的製表字元應該被刪除或替換為空格,因為它們違反了[[WT:NORM]]。",
	breadcrumb = "製表字元",
	parents = {"維基詞典維護"},
	can_be_empty = true,
	hidden = true,
}

raw_categories["語言標題順序錯誤的頁面"] = {
	description = "語言詞條的標題順序錯誤的頁面。",
	additional = "Level 2 language headings should be in alphabetical order, except for Translingual and English, which go at the top (in that order).",
	breadcrumb = "語言標題順序錯誤",
	parents = {"維基詞典維護"},
	can_be_empty = true,
	hidden = true,
}

raw_categories["帶有非標準語言標題的頁面"] = {
	description = "Pages which contain a level 2 heading which does not match any language's canonical name.",
	additional = "The level 2 language heading for each language should always be that language's canonical name.",
	breadcrumb = "非標準語言標題",
	parents = {"維基詞典維護"},
	can_be_empty = true,
	hidden = true,
}

raw_categories["包含不需要的L1標題的頁面"] = {
	description = "包含不需要的L1標題的頁面",
	additional = "L1標題維基詞典內容頁面,僅因使用者錯誤或故意破壞而出現。",
	breadcrumb = "不需要的L1標題",
	parents = {"維基詞典維護"},
	can_be_empty = true,
	hidden = true,
}

raw_categories["帶有原始三重括號模板參數的頁面"] = {
	description = "包含三重括號形式的原始模板參數的頁面。",
	additional = "三重大括號模板參數(例如{{code|<nowiki>{{{arg}}}</nowiki>}})被用於模板中,因為當頁面被嵌入時,它們會被相關的模板參數取代。儘管理論上它們可以在任何頁面上使用,但目前它們在內容命名空間中沒有合法用途。\n\n此分類中的模板參數通常是由於拼寫錯誤或當 {{tl|subst:}} 與不應替換的模板一起使用時出現的。",
	breadcrumb = "Raw template arguments",
	parents = {"維基詞典維護"},
	can_be_empty = true,
	hidden = true,
}

raw_categories["存在DEFAULTSORT衝突的頁面"] = {
	topright = "{{shortcut|CAT:DEFAULTSORT}}",
	description = "魔術字 {{tl|DEFAULTSORT:}} 被多次使用且有不同值的頁面。",
	additional = "在某些(但不是全部)情況下,這會導致頁面上顯示警告。在絕大多數情況下,應該<u>刪除</u> wikitext 中明確使用的 {{tl|DEFAULTSORT:}}。這是因為 {{tl|head}} 模板會對其自動處理。在 wikitext 中應使用它的唯一情況是在條目(即主命名空間或重構命名空間)之外。" ..
		"\n\n亦請參見[[:Category:存在DISPLAYTITLE衝突的頁面]]。",
	breadcrumb = "DEFAULTSORT衝突",
	parents = {"維基詞典維護"},
	can_be_empty = true,
	hidden = true,
}

raw_categories["存在DISPLAYTITLE衝突的頁面"] = {
	topright = "{{shortcut|CAT:DISPLAYTITLE}}",
	description = "魔術字 {{tl|DISPLAYTITLE:}} 被多次使用且有不同值的頁面。",
	additional = "在某些(但不是全部)情況下,這會導致頁面上顯示警告。在絕大多數情況下,應該<u>刪除</u> wikitext 中明確使用的 {{tl|DISPLAYTITLE:}}。這是因為 {{tl|head}} 模板會對其自動處理。在 wikitext 中應使用它的唯一情況是在條目(即主命名空間或重構命名空間)之外。" ..
		"\n\n亦請參見[[:Category:存在DEFAULTSORT衝突的頁面]]。",
	breadcrumb = "DISPLAYTITLE衝突",
	parents = {"維基詞典維護"},
	can_be_empty = true,
	hidden = true,
}

raw_categories["帶有原始排序鍵的頁面"] = {
	description = "使用帶有原始類別的排序鍵的頁面。",
	additional = "例如,{{code|<nowiki>[[Category:國際音標符號|B]]</nowiki>}}。" ..
	"\n\n它們應優先用分類模板替換,因為它們是硬編碼的,而且會覆蓋頁面的 {{tl|DEFAULTSORT:}} 值。如果分類的排序方案有任何變化,這會導致頁面沒有辦法被集中更改。\n\n" ..
	"相較之下,沒有排序鍵的原始分類問題較小,因為它們會使用 {{tl|DEFAULTSORT:}} 值;這可以集中控制,而且設計上不偏向任何語言,因此避免了不同編者對同一分類使用多種不同排序方案的問題。不過,這些分類仍應以分類模板取代,因為可能還有其他特定語言的排序規則無法套用。",
	breadcrumb = "原始排序鍵",
	parents = {"維基詞典維護"},
	can_be_empty = true,
	hidden = true,
}

raw_categories["有脚本错误的页面"] = {
	topright = "{{shortcut|CAT:E|CAT:ERR|CAT:ERROR}}",
	description = "[[Wiktionary:Scribunto|Lua]]-{zh-hans:模块; zh-hant:模組}-中存在錯誤的頁面。",
	additional = "如果頁面長期駐留於此,則可能應在<!--[[Wiktionary:GP|the Grease Pit]]-->[[Wiktionary:啤酒館|啤酒館]]報告錯誤。記憶體錯誤是這些錯誤的常見來源;請參閱[[:en:Wiktionary:Lua memory errors|Wiktionary:Lua記憶體錯誤]]中的討論。" ..
		"\n\n由於-{zh-hans:软件; zh-hant:軟體}-在模板或-{zh-hans:模块; zh-hant:模組}-發生變更時不會立即更新頁面,因此此處列出的錯誤可能已修復。請確保錯誤仍然存在,然後再報告問題。您可以藉由執行[[meta:Help:Dummy_edit#Null_edit|空編輯]](編輯並儲存頁面而不進行實際變更)來執行此操作。如果錯誤消失,則表示已修復。" ..
		"\n\n<u>您可以使用[https://zh.wiktionary.org/wiki/Special:ApiSandbox#action=purge&format=json&forcelinkupdate=1&generator=categorymembers&utf8=1&formatversion=2&gcmtitle=Category%3A有脚本错误的页面&gcmlimit=20 此-{zh-hans:链接; zh-hant:連結}-] 並按「送出請求」,一次點擊即可清除此分類中最多20個頁面的-{zh-hans:缓存; zh-hant:快取}-。</u>此數字最多可調整為 5,000,但超過 30-100 的任何數字都可能會導致逾時(取決於頁面大小)。" ..
		"\n\n此類別的內容由[[Template:maintenance category]]控制。目前設定為將討論頁面、使用者頁面以及使用者沙盒模組和模板本放在單獨的分類中。" ..
		"\n\n另請參閱[[:Category:有解析器函數錯誤的頁面]]。",
	breadcrumb = "腳本錯誤",
	parents = {"維基詞典維護"},
	can_be_empty = true,
	hidden = true,
}

raw_categories["有解析器函數錯誤的頁面"] = {
	topright = "{{shortcut|CAT:PFE}}",
	description = "[[mw:Help:Extension:ParserFunctions|解析器函數]]魔術字有錯誤的頁面。",
	additional = "這類魔術字的例子包括 {{tl|#expr:}} 和 {{tl|#time:}} 等。如果頁面長期駐留於此,則可能應在<!--[[Wiktionary:GP|the Grease Pit]]-->[[Wiktionary:啤酒館|啤酒館]]報告錯誤。記憶體錯誤是這些錯誤的常見來源;請參閱[[:en:Wiktionary:Lua memory errors|Wiktionary:Lua記憶體錯誤]]中的討論。" ..
		"\n\n由於-{zh-hans:软件; zh-hant:軟體}-在模板或-{zh-hans:模块; zh-hant:模組}-發生變更時不會立即更新頁面,因此此處列出的錯誤可能已修復。請確保錯誤仍然存在,然後再報告問題。您可以藉由執行[[meta:Help:Dummy_edit#Null_edit|空編輯]](編輯並儲存頁面而不進行實際變更)來執行此操作。如果錯誤消失,則表示已修復。" ..
		"\n\n<u>您可以使用[https://zh.wiktionary.org/wiki/Special:ApiSandbox#action=purge&format=json&forcelinkupdate=1&generator=categorymembers&utf8=1&formatversion=2&gcmtitle=Category%3A有解析器函數錯誤的頁面&gcmlimit=20 此-{zh-hans:链接; zh-hant:連結}-] 並按「送出請求」,一次點擊即可清除此分類中最多20個頁面的-{zh-hans:缓存; zh-hant:快取}-。</u>此數字最多可調整為 5,000,但超過 30-100 的任何數字都可能會導致逾時(取決於頁面大小)。" ..
		"\n\n此類別的內容由[[Template:maintenance category]]控制。目前設定為將討論頁面、使用者頁面以及使用者沙盒模組和模板本放在單獨的分類中。" ..
		"\n\n另請參閱[[:Category:有脚本错误的页面]]。",
	breadcrumb = "解析器函數錯誤",
	parents = {"維基詞典維護"},
	can_be_empty = true,
	hidden = true,
}

raw_categories["移動、合併和拆分請求"] = {
	description = "已標記請求移動、合併或拆分的頁面和分類。",
	breadcrumb = "移動、合併和拆分",
	parents = {"維基詞典維護", "請求"},
	can_be_empty = true,
	hidden = true,
}

raw_categories["待合併的頁面"] = {
	description = "被 {{tl|merge}} 模板標記為待合併的頁面。",
	parents = {"移動、合併和拆分請求"},
	can_be_empty = true,
}

raw_categories["待移動的頁面"] = {
	description = "被 {{tl|move}} 模板標記為待移動的頁面。",
	parents = {"移動、合併和拆分請求"},
	can_be_empty = true,
}

raw_categories["待拆分的頁面"] = {
	description = "被 {{tl|split}} 模板標記為待拆分的頁面。",
	parents = {"移動、合併和拆分請求"},
	can_be_empty = true,
}

raw_categories["呼叫模板時使用錯誤參數的頁面"] = {
	description = "呼叫模板時使用無法辨識的參數的頁面。",
	breadcrumb = "錯誤模板參數",
	parents = {"維基詞典維護"},
	can_be_empty = true,
}

raw_categories["使用棄用來源標籤的頁面"] = {
	description = "使用 [[mw:Extension:SyntaxHighlight|SyntaxHighlight]] 擴充功能以及舊版 {{wt|source}} 標籤而不是 {{wt|syntaxhighlight}} 的頁面。",
	breadcrumb = "棄用來源標籤",
	parents = {"維基詞典維護"},
	can_be_empty = true,
	hidden = true,
}

table.insert(raw_handlers, function(data)
	local template_type = data.category:match("^呼叫(.+)模板時使用錯誤參數的頁面$")
	if template_type then
		local parents = {{
			name = "呼叫模板時使用錯誤參數的頁面",
			sort = template_type == "general use" and "*" or template_type,
		}}
		local lang = require("Module:languages").getByCanonicalName(template_type, nil, true)
		if lang then
			table.insert(parents, {name = "詞條維護", is_label = true, lang = lang:getCode()})
		end
		return {
			lang = lang and lang:getCode() or nil,
			description = "呼叫" .. template_type .. "模板時使用錯誤參數的頁面。",
			parents = parents,
			breadcrumb = template_type,
		}
	end
end)

table.insert(raw_handlers, function(data)
	local template = data.category:match("^呼叫(.+)時使用錯誤參數的頁面$")

	function get_template_language(template_name)
        -- convert "R:es:DRAE" and "RQ:es:DRAE" to "es-DRAE" for language matching
        template_name = template_name:gsub("^RQ?:", "")
        template_name = template_name:gsub(":", "-")

		-- Check if the template name starts with a hyphenated language code
		local lang
		possible_language_code = template_name:match("^([a-z][a-z][a-z]?-[a-z][a-z][a-z])-")
		if possible_language_code ~= nil then
			lang = require("Module:languages").getByCode(possible_language_code)
		end

		-- Check if the template name starts with a two or three character language code
		if lang == nil then
			possible_language_code = template_name:match("^([a-z][a-z][a-z]?)-")
			if possible_language_code ~= nil then
				lang = require("Module:languages").getByCode(possible_language_code)
			end
		end

 		return lang
	end


	if template then
        template_name_without_namespace = template:gsub("^Template:", "")

		lang = get_template_language(template_name_without_namespace)

		local template_type
		if lang == nil then
			template_type = "general use"
		else
			template_type = lang:getCanonicalName()
		end

		return {
			lang = lang and lang:getCode() or nil,
			description = "呼叫[[" .. template .. "]]時使用無法辨識的參數的頁面。",
	        additional = "請檢查這些模板調用並更正或刪除錯誤的參數。",
			breadcrumb = template,
			parents = {{
				name = "呼叫" .. template_type .. "模板時使用錯誤參數的頁面",
				sort = template_name_without_namespace,
			}},
			can_be_empty = true,
			hidden = true,
		}
	end
end)

return {RAW_CATEGORIES = raw_categories, RAW_HANDLERS = raw_handlers}