본문으로 이동

모듈:category tree/wiktionary maintenance

위키낱말사전, 말과 글의 누리

이 모듈에 대한 설명문서는 모듈:category tree/wiktionary maintenance/설명문서에서 만들 수 있습니다

local raw_categories = {}
local raw_handlers = {}

local m_template_parser = require("Module:template parser/sandbox")

local get_lang = require("Module:languages").getByCode
local insert = table.insert
local is_internal_title = require("Module:pages").is_internal_title
local new_title = mw.title.new
local split_lang_label = require("Module:category tree").split_lang_label
local php_trim = require("Module:Scribunto").php_trim
local uses_hidden_category = require("Module:maintenance category").uses_hidden_category

-----------------------------------------------------------------------------
--                                                                         --
--                              원시(RAW) 분류                             --
--                                                                         --
-----------------------------------------------------------------------------

raw_categories["위키낱말사전 관리"] = {
	description = "편집자의 관심과 개선이 필요한 문서를 추적하는 분류입니다.",
	breadcrumb = "관리",
	parents = "위키낱말사전",
}

raw_categories["비어있는 분류"] = {
	topright = "{{바로가기|CAT:EC}}",
	description = "구성원이 없는 분류.",
	additional = [=[분류에 문서나 하위 분류가 없을 때 [[모듈:category tree]]에 의해 여기에 분류됩니다.
빈 분류가 반드시 문제가 되는 것은 아니지만, 상위 분류를 복잡하게 만들거나 분류 트리 구조가 변경될 경우 고립될 수 있습니다. 따라서 이 분류는 그러한 경우를 추적하고 정리하는 데 도움이 됩니다.
위키 소프트웨어의 작동 방식 때문에, 처음에는 비어 있었지만 나중에 항목이 추가된 경우에도 한동안 여기에 나타날 수 있습니다. 이는 분류 문서에서 "빈 편집"(문서를 편집하고 변경 없이 저장)을 수행하면 해결할 수 있습니다. (또는 [[특수:환경설정#mw-prefsection-gadgets|소도구]] "새로고침 탭"이 제공하는 "빈 편집" 옵션을 사용하세요.) 이는 분류를 만들기 전에 항목을 추가함으로써 피할 수 있습니다. 또한 분류를 "아래에서 위로" 만드는 것도 도움이 됩니다: 항목이 있는 가장 낮은 수준에서 시작하여 그 부모 분류를 만들고, 그 다음 부모 분류를 만드는 식으로 진행하십시오.]=],
	parents = "위키낱말사전 관리",
	can_be_empty = true,
	hidden = true,
}

raw_categories["이름이 올바르지 않은 분류"] = {
	description = "분류 트리 내에서 예상되는 형식과 일치하지 않는 이름을 가진 분류.",
	additional = [=[이는 보통 {{틀|자동 분류}}에 분류 이름과 일치하지 않는 추가 매개변수가 주어졌거나, 분류 이름의 대소문자나 띄어쓰기에 문제가 있을 때 발생합니다.
==같이 보기==
* [[:분류:분류 체계에 정의되지 않은 분류]]]=],
	parents = "위키낱말사전 관리",
	can_be_empty = true,
	hidden = true,
}

raw_categories["분류 체계에 정의되지 않은 분류"] = {
	description = "{{틀|자동 분류}}를 사용하지만, 분류 트리 데이터 모듈에 등록되지 않은 분류.",
	additional = [=[자세한 정보는 이 분류들 중 하나에 표시되는 오류 상자를 참고하십시오.
==같이 보기==
* [[:분류:이름이 올바르지 않은 분류]]]=],
	parents = "위키낱말사전 관리",
	can_be_empty = true,
	hidden = true,
}

raw_categories["숨은 분류"] = {
	description = "<code>[[mw:Help:Magic words#HIDDENCAT|<nowiki>__HIDDENCAT__</nowiki>]]</code> 동작 스위치를 사용하는 분류. 이 스위치는 해당 분류의 구성원 및 하위 분류 목록에서 이 분류를 숨깁니다.",
	parents = "위키낱말사전 관리",
	can_be_empty = true,
	hidden = true,
}

raw_categories["Huge categories"] = {
	description = "Categories with more than 1 million members.",
	additional = "Such categories have the [[mw:Extension:DynamicPageList (Wikimedia)|DynamicPageList]] extension disabled, which is normally used to list the newest and oldest pages in a category. This is because categories above that size load very slowly when it is enabled, and in some cases become inaccessible due to timing-out.",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
	hidden = true,
}

raw_categories["Indexed pages"] = {
	description = "Pages using the <code>[[mw:Help:Magic words#INDEX|<nowiki>__INDEX__</nowiki>]]</code> behavior switch, which tells search engines to index the page.",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
	hidden = true,
}

raw_categories["Noindexed pages"] = {
	description = "Pages using the <code>[[mw:Help:Magic words#NOINDEX|<nowiki>__NOINDEX__</nowiki>]]</code> behavior switch, which tells search engines not to index the page.",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
	hidden = true,
}

raw_categories["Pages using deprecated templates"] = {
	description = "This category contains entries, reconstruction pages, appendixes, sign glosses and citations pages using deprecated templates—templates that have failed our deletion process, and/or that have been replaced by superior templates.",
	additional = [=[This category is populated by {{tl|deprecated code}} and {{tl|deprecated lang param usage}}. The former is wrapped around templates that have been completely deprecated and remove from mainspace (particularly those in [[:Category:Successfully deprecated templates]]). The latter is wrapped around non-deprecated templates that accept the deprecated {{para|lang}} parameter; any use of that parameter will place the page in [[:Category:Pages using deprecated templates]]. Ideally, this category will be empty. 

Any pages in this category, particularly those in the mainspace, need to have their deprecated template usages corrected. ]=],
	breadcrumb = "Using deprecated templates",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
	hidden = true,
}

raw_categories["Pages using lite templates"] = {
	description = "Pages which use at least one of the lite templates.",
	additional = "See [[:Category:Lua-free templates]].",
	breadcrumb = "Using lite templates",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
	hidden = true,
}

raw_categories["Pages with tab characters"] = {
	description = "Pages which contain a tab character in their wikitext.",
	additional = "These should either be removed or replaced with spaces, because they go against [[WT:NORM]].",
	breadcrumb = "Tab characters",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
	hidden = true,
}

raw_categories["Pages with language headings in the wrong order"] = {
	description = "Pages in which the headings for each language's entry are in the wrong order.",
	additional = "Level 2 language headings should be in alphabetical order, except for Translingual and English, which go at the top (in that order).",
	breadcrumb = "Language headings in the wrong order",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
	hidden = true,
}

raw_categories["Pages with nonstandard language headings"] = {
	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 = "Nonstandard language headings",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
	hidden = true,
}

raw_categories["Pages with unwanted L1 headings"] = {
	description = "Pages which contain an unwanted level 1 heading.",
	additional = "Level 1 headings are not used in Wiktionary content pages, and only occur due to user error or vandalism.",
	breadcrumb = "Unwanted L1 headings",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
	hidden = true,
}

raw_categories["Pages with raw triple-brace template parameters"] = {
	description = "Pages which contain raw template parameters in the form of triple braces.",
	additional = "Triple-brace template parameters (e.g. {{param|param}}) are intended for use in templates, as they are substituted with the relevant template argument when the page is transcluded. Although they can theoretically be used on any page, there are currently no legitimate uses for them in content namespaces.\n\nTemplate parameters usually occur due to typos, or when {{tl|subst:}} has been used with a template that isn't supposed to be substed.",
	breadcrumb = "Raw template parameters",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
	hidden = true,
}

raw_categories["Pages with DEFAULTSORT conflicts"] = {
	topright = "{{shortcut|CAT:DEFAULTSORT}}",
	description = "Pages on which the {{tl|DEFAULTSORT:}} magic word has been used multiple times with different values.",
	additional = "In some (but not all) cases, this causes a warning to display on the page. In the vast majority of instances, an explicit use of {{tl|DEFAULTSORT:}} in wikitext should be <u>removed</u>.This is because the {{tl|head}} template handles it automatically. The only instances where it should be used in wikitext is outside of entries (i.e. outside of mainspace or the Reconstruction namespace)." ..
		"\n\nSee also [[:Category:Pages with DISPLAYTITLE conflicts]].",
	breadcrumb = "DEFAULTSORT conflicts",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
	hidden = true,
}

raw_categories["Pages with DISPLAYTITLE conflicts"] = {
	topright = "{{shortcut|CAT:DISPLAYTITLE}}",
	description = "Pages on which the {{tl|DISPLAYTITLE:}} magic word has been used multiple times with different values.",
	additional = "In some (but not all) cases, this causes a warning to display on the page. In the vast majority of instances, an explicit use of {{tl|DISPLAYTITLE:}} in wikitext should be <u>removed</u>.This is because the {{tl|head}} template handles it automatically. The only instances where it should be used in wikitext is outside of entries (i.e. outside of mainspace or the Reconstruction namespace)." ..
		"\n\nSee also [[:Category:Pages with DEFAULTSORT conflicts]].",
	breadcrumb = "DISPLAYTITLE conflicts",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
	hidden = true,
}

raw_categories["Pages with raw sortkeys"] = {
	description = "Pages on which a sortkey has been used with a raw category.",
	additional = "For example, {{code|[[<nowiki/>Category:IPA symbols|B]]}}." ..
	"\n\nThese are a priority to replace with category templates, since they are hard-coded and override the {{tl|DEFAULTSORT:}} value for the page. This causes problems if there are any changes to the sorting scheme for the category, because there is no way of changing them centrally.\n\n" ..
	"By comparison, raw categories which have no sortkey are less of a problem, because they will use the {{tl|DEFAULTSORT:}} value; this can be centrally controlled and is designed to be language-neutral, so avoids the issue of different editors using multiple different sorting schemes for the same category. However, they should still be replaced with category templates, since there may be additional language-specific sorting rules which cannot otherwise be applied.",
	breadcrumb = "Raw sortkeys",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
	hidden = true,
}

raw_categories["스크립트 오류가 있는 문서"] = {
	topright = "{{단축|분류:E|분류:ERR|분류:오류}}",
	description = "[[위키낱말사전:Scribunto|루아(Lua)]] 모듈에 오류가 있는 문서.",
	additional = "항목이 여기에 하루 이틀 이상 목록에 남아 있다면, [[위키낱말사전:사랑방|사랑방]]에 오류를 보고해야 합니다. 메모리 오류는 이러한 오류의 일반적인 원인입니다. [[위키낱말사전:루아 메모리 오류]]의 논의를 참고하십시오." ..
		"\n\n소프트웨어는 틀이나 모듈이 변경되었을 때 문서를 즉시 업데이트하지 않기 때문에, 여기에 나열된 오류는 이미 수정되었을 수 있습니다. 따라서 문제를 보고하기 전에 오류가 여전히 존재하는지 확인하십시오. \"[[mw:Help:Dummy_edit#A_null_edit|빈 편집]]\"(문서를 편집하고 변경 없이 저장)을 수행하여 이를 확인할 수 있습니다. 만약 오류가 사라진다면, 이미 수정된 것입니다." ..
		"\n\n<u>[https://ko.wiktionary.org/wiki/Special:ApiSandbox#action=purge&format=json&forcelinkupdate=1&generator=categorymembers&utf8=1&formatversion=2&gcmtitle=분류%3A스크립트%20오류가%20있는%20문서&gcmlimit=20 이 링크]를 사용하고 \"요청 보내기\"를 눌러 이 분류의 최대 20개 문서 캐시를 한 번에 비울 수 있습니다.</u> 이 숫자는 최대 5,000까지 조정할 수 있지만, 30~100개를 초과하면 (문서 크기에 따라) 시간 초과가 발생할 수 있습니다." ..
		"\n\n이 분류의 내용은 [[틀:관리 분류]]에 의해 제어됩니다. 현재 토론 문서, 사용자 문서, 사용자 샌드박스 모듈 및 틀을 별도의 분류에 배치하도록 설정되어 있습니다." ..
		"\n\n[[:분류:파서 함수 오류가 있는 문서]]도 참고하십시오.",
	breadcrumb = "스크립트 오류",
	parents = "위키낱말사전 관리",
	can_be_empty = true,
	hidden = true,
}

raw_categories["파서 함수 오류가 있는 문서"] = {
	topright = "{{바로가기|CAT:PFE}}",
	description = "[[mw:Help:Extension:ParserFunctions|파서 함수]] 매직 워드에 오류가 있는 문서.",
	additional = "이러한 매직 워드의 예시로는 {{틀|#expr:}}과 {{틀|#time:}}이 있습니다. 항목이 여기에 하루 이틀 이상 남아 있다면, [[위키낱말사전:사랑방|사랑방]]에 오류를 보고해야 합니다." ..
		"\n\n소프트웨어는 틀이나 모듈이 변경되었을 때 문서를 즉시 업데이트하지 않기 때문에, 여기에 나열된 오류는 이미 수정되었을 수 있습니다. 따라서 문제를 보고하기 전에 오류가 여전히 존재하는지 확인하십시오. \"[[meta:Help:Dummy_edit#Null_edit|빈 편집]]\"(문서를 편집하고 변경 없이 저장)을 수행하여 이를 확인할 수 있습니다. 만약 오류가 사라진다면, 이미 수정된 것입니다." ..
		"\n\n<u>[https://ko.wiktionary.org/wiki/Special:ApiSandbox#action=purge&format=json&forcelinkupdate=1&generator=categorymembers&utf8=1&formatversion=2&gcmtitle=분류%3A파서%20함수%20오류가%20있는%20문서&gcmlimit=20 이 링크]를 사용하고 \"요청 보내기\"를 눌러 이 분류의 최대 20개 문서 캐시를 한 번에 비울 수 있습니다.</u> 이 숫자는 최대 5,000까지 조정할 수 있지만, 30~100개를 초과하면 (문서 크기에 따라) 시간 초과가 발생할 수 있습니다." ..
		"\n\n이 분류의 내용은 [[틀:관리 분류]]에 의해 제어됩니다. 현재 토론 문서, 사용자 문서, 사용자 샌드박스 모듈 및 틀을 별도의 분류에 배치하도록 설정되어 있습니다." ..
		"\n\n[[:분류:스크립트 오류가 있는 문서]]도 참고하십시오.",
	breadcrumb = "파서 함수 오류",
	parents = "위키낱말사전 관리",
	can_be_empty = true,
	hidden = true,
}

raw_categories["Requests for moves, mergers and splits"] = {
	description = "Pages and categories which have been tagged with a request for them to be moved, merged or split.",
	breadcrumb = "Moves, mergers and splits",
	parents = {"Wiktionary maintenance", "Requests"},
	can_be_empty = true,
	hidden = true,
}

raw_categories["Pages to be merged"] = {
	description = "Pages tagged to be merged by the {{tl|merge}} template.",
	parents = "Requests for moves, mergers and splits",
	can_be_empty = true,
}

raw_categories["Pages to be moved"] = {
	description = "Pages tagged to be moved by the {{tl|move}} template.",
	parents = "Requests for moves, mergers and splits",
	can_be_empty = true,
}

raw_categories["Pages to be split"] = {
	description = "Pages tagged to be split by the {{tl|split}} template.",
	parents = "Requests for moves, mergers and splits",
	can_be_empty = true,
}

raw_categories["Pages using invalid parameters when calling templates"] = {
	description = "Pages that use unrecognized parameters when calling a template.",
	breadcrumb = "Invalid template parameters",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
}

raw_categories["catfix를 사용하는 문서"] = {
	description = "<code>[[MediaWiki:Gadget-catfix.js|catfix]]</code> 소도구를 사용하는 문서.",
	additional = "이 소도구는 언어별 분류의 항목 링크에 언어별 서식을 추가하고, 항목의 해당 언어 문단으로 연결되도록 처리합니다.",
	parents = "위키낱말사전 관리",
	can_be_empty = true,
	hidden = true,
}

raw_categories["Pages calling Template:minitoc"] = {
	description = "Pages that display a mini table of contents by calling {{tl|minitoc}}.",
	additional = "This is is used on very large pages with many entries, to assist with navigation.",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
	hidden = true,
}

raw_categories["틀:자동 분류를 호출하는 분류"] = {
	description = "Categories that have been placed in another category by calling {{tl|auto cat}}.",
	additional = "This is the preferred way for categories to be subcategorized. The chief reason for this category is to facilitate the finding of categories which are not using {{tl|auto cat}} through the use of negative searches (e.g. qualifying a search with {{code|-incategory:\"{{PAGENAME}}\"}}).",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
	hidden = true,
}

raw_categories["Categories with categories using raw markup"] = {
	description = "Categories that have been placed in another category using raw wiki markup (e.g. {{cl|Wiktionary}}). They should be added to the [[Module:category tree|category tree]] data instead.",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
	hidden = true,
}

raw_categories["Pages using deprecated source tags"] = {
	description = "Pages that use the [[mw:Extension:SyntaxHighlight|SyntaxHighlight]] extension with legacy {{wt|source}} tags instead of {{wt|syntaxhighlight}}.",
	breadcrumb = "Deprecated source tags",
	parents = "Wiktionary maintenance",
	can_be_empty = true,
	hidden = true,
}

insert(raw_handlers, function(data)
	-- 예: "일반용 틀을 호출할 때 잘못된 매개변수를 사용하는 문서"
	local template_type = data.category:match("^(.+) 틀을 호출할 때 잘못된 매개변수를 사용하는 문서$")
	if not template_type then
		return
	end
	local parents = {{
		name = "틀 호출 시 잘못된 매개변수를 사용하는 문서",
		sort = template_type == "일반용" and "*" or template_type,
	}}
	local lang = require("Module:languages").getByCanonicalName(template_type, nil, true)
	if lang then
		insert(parents, {name = "entry maintenance", is_label = true, lang = lang:getCode()})
	end
	
	return {
		lang = lang and lang:getCode() or nil,
		description = template_type .. " 틀을 호출할 때 인식할 수 없는 매개변수를 사용하는 문서.",
		parents = parents,
		breadcrumb = template_type,
	}
end)

do
	local prefixes = require("Module:table").listToSet{"list", "P", "R", "RQ", "table", "U"}
	
	local function add_parent(parents, seen, cat_type, sortkey)
		if seen[cat_type] then return end
		insert(parents, {
			name = ("%s 틀을 호출할 때 잘못된 매개변수를 사용하는 문서"):format(cat_type),
			sort = sortkey,
		})
		seen[cat_type] = true
	end
	
	insert(raw_handlers, function(data)
		local template = data.category:match("^(.+) 틀 호출 시 잘못된 매개변수를 사용하는 문서$")
		
		if not template then
			return
		end
		
		-- Resolve any redirects.
		template = new_title(template)
		while template do
			local redirect = template.redirectTarget
			if not (redirect and is_internal_title(redirect)) then
				break
			end
			template = redirect
		end
		
		-- Disallow templates which would always hidden maintennace categories (e.g. sandboxes).
		if not (template and not uses_hidden_category(template)) then
			return
		end
		
		local prefixed_text, lang = template.prefixedText
		if template.namespace == 10 then
			local name = template.text
			-- Remove the prefix if present (e.g. "R:" or "RQ:").
			local prefix, text = name:match("^(.-):(.+)")
			if not (prefix and prefixes[prefix]) then
				text = name
			end
			-- Check the initial language code, chopping off hyphenated sections until there's a match or they run out.
			local code = mw.ustring.match(text, "^[a-z][a-zA-Z-]*[a-zA-Z]%f[^%w]")
			while code do
				lang = get_lang(code)
				if lang then
					break
				end
				code = code:match("(.+)%-%a*$")
			end
			-- If no match and it's a list: or table: template, check if the template name ends "/CODE".
			if not lang and (prefix == "list" or prefix == "table") then
				code = text:match("%f[^/]%l[%a-]*%a$")
				if code then
					lang = get_lang(code)
				end
			end
		end
		
		local sortkey = template.text
		local parents, seen = {}, {}
		
		-- Categorize as language-specific if a language was found.
		if lang then
			add_parent(parents, seen, lang:getCanonicalName(), sortkey)
		end
		
		-- Also grab any language categories from the template page.
		for _, cat in ipairs(template.categories) do
			if cat:sub(-10) == " templates" or cat:sub(-13) == " subtemplates" then
				local cat_lang = split_lang_label(new_title(cat).text)
				if cat_lang then
					add_parent(parents, seen, cat_lang:getCanonicalName(), sortkey)
				end
			end
		end
		
		-- If none were found, categorize as general use.
		if #parents == 0 then
			add_parent(parents, seen, "general use", sortkey)
		end
		
		-- Only add can_be_empty if the template exists and contains checkparams.
		local content, can_be_empty = template:getContent()
		if content then
			-- Check for {{#invoke:checkparams|warn|...}}.
			-- args[1] is the module and args[2] is the function name, so #INVOKE: will throw an error if either is not present.
			for template in require("Module:template parser/sandbox").find_templates(content) do
				if template:get_name() == "#INVOKE:" then
					local args = template:get_arguments()
					local arg_2 = args[2]
					if arg_2 and php_trim(args[1]) == "checkparams" and php_trim(arg_2) == "warn" then
						can_be_empty = true
						break
					end
				end
			end
		end
		
		return {
			canonical_name = prefixed_text .. " 틀 호출 시 잘못된 매개변수를 사용하는 문서",
			lang = lang and lang:getCode() or nil,
			description = ("{{틀|%s}} 호출 시 인식할 수 없는 매개변수를 사용하는 문서."):format(m_template_parser.getTemplateInvocationName(template)),
			additional = "이러한 틀 호출은 검토되어야 하며, 유효하지 않은 매개변수는 수정되거나 제거되어야 합니다.",
			breadcrumb = prefixed_text,
			parents = parents,
			can_be_empty = can_be_empty,
			hidden = true,
		}
	end)
end

return {RAW_CATEGORIES = raw_categories, RAW_HANDLERS = raw_handlers}