모듈:category tree/entry maintenance
보이기
이 모듈에 대한 설명문서는 모듈:category tree/entry maintenance/설명문서에서 만들 수 있습니다
local labels = {}
local raw_categories = {}
local raw_handlers = {}
local functions_module = "Module:fun"
local languages_module = "Module:languages"
local scripts_module = "Module:scripts"
local string_pattern_escape_module = "Module:string/patternEscape"
local string_replacement_escape_module = "Module:string/replacementEscape"
local table_module = "Module:table"
local extend = require(table_module).extend
local is_callable = require(functions_module).is_callable
local pattern_escape = require(string_pattern_escape_module)
local replacement_escape = require(string_replacement_escape_module)
local unpack = unpack or table.unpack -- Lua 5.2 호환성
-----------------------------------------------------------------------------
-- --
-- 레이블 --
-- --
-----------------------------------------------------------------------------
labels["문서 관리"] = {
description = "편집자의 관심과 개선이 필요한 {{{langname}}} 항목, 또는 {{{langname}}} 낱말을 포함하는 다른 언어 항목을 추적하는 분류입니다.",
parents = {{name = "{{{langcat}}}", raw = true}},
umbrella_parents = "기본",
}
labels["잘못된 언어 헤더가 있는 항목"] = {
description = "잘못된 언어 헤더 아래에 놓인 {{{langname}}} 항목.",
additional = "다음과 같은 여러 이유로 발생할 수 있습니다:\n" ..
"* 오타.\n" ..
"* 반달리즘.\n" ..
"* 잘못된 언어 코드 사용.\n" ..
"* 언어의 다른 이름 사용.\n" ..
"* 언어 데이터 모듈에 지정된 이름에 사용되지 않은 특수 문자 사용.",
parents = {"문서 관리"},
can_be_empty = true,
hidden = true,
}
labels["entries without References header"] = {
description = "{{{langname}}} 항목 중 '참고 문헌' 문단이 없는 문서.",
parents = {"문서 관리"},
can_be_empty = true,
hidden = true,
}
labels["entries without References or Further reading header"] = {
description = "{{{langname}}} 항목 중 '참고 문헌' 또는 '같이 보기' 문단이 없는 문서.",
parents = {},
can_be_empty = true,
hidden = true,
}
labels["entries that don't exist"] = {
description = "[[위키낱말사전:등재 기준|등재 기준]](CFI)을 충족하지 못하는 {{{langname}}} 낱말. {{틀|등재 기준 미충족|{{{langcode}}}}} 틀로 이 분류에 추가됩니다.",
parents = {"문서 관리"},
umbrella_parents = "기본",
}
labels["entries with etymology trees"] = {
description = "{{{langname}}} 항목 중 {{틀|etymon}} 틀로 생성된 어원 트리(etymology tree)를 표시하는 문서.",
parents = {"문서 관리"},
can_be_empty = true,
hidden = true,
}
labels["entries with etymology texts"] = {
description = "{{{langname}}} 항목 중 {{틀|etymon}} 틀로 생성된 어원을 표시하는 문서.",
parents = {"문서 관리"},
can_be_empty = true,
hidden = true,
}
labels["entries referencing etymons with invalid IDs"] = {
description = "{{틀|etymon}} 틀을 잘못된 ID로 사용한 항목. 예: {{code|항목>언어>존재하지 않는 ID}} 또는 {{code|언어>존재하지 않는 항목>존재하지 않는 ID}}",
parents = {"문서 관리"},
can_be_empty = true,
hidden = true,
}
labels["entries with language name categories using raw markup"] = {
description = "{{{langname}}} 항목 중 원시 위키 마크업(예: {{code|[[<nowiki/>분류:{{{langname}}} ...]]}})을 사용하여 언어 이름 분류에 포함된 문서. 대신 {{틀|분류 추가|{{{langcode}}}|...}}를 사용해야 합니다.",
parents = {"문서 관리"},
can_be_empty = true,
hidden = true,
}
labels["entries with topic categories using raw markup"] = {
description = "{{{langname}}} 항목 중 원시 위키 마크업(예: {{code|[[<nowiki/>분류:{{{langcode}}}:...]]}})을 사용하여 주제 분류에 포함된 문서. 대신 {{틀|C|{{{langcode}}}|...}}를 사용해야 합니다.",
parents = {"문서 관리"},
can_be_empty = true,
hidden = true,
}
labels["entries with outdated source"] = {
description = "{{{langname}}} 항목 중 오래된 출처에서 일부 또는 전체가 인용된 문서.",
parents = {"문서 관리"},
}
labels["undefined derivations"] = {
description = "{{{langname}}} 어원 중 {{틀|undefined derivation}}을 사용하는 문서. 대신 {{틀|borrowed}}이나 {{틀|inherited}}과 같은 더 구체적인 틀을 사용해야 합니다.",
parents = {"문서 관리"},
can_be_empty = true,
hidden = true,
}
labels["descendants to be fixed in desctree"] = {
description = "{{틀|desctree}}를 사용하여 '파생어' 문단이 없는 {{{langname}}} 항목으로 링크하는 문서.",
parents = {"문서 관리"},
can_be_empty = true,
hidden = true,
}
labels["term requests"] = {
description = "[[틀:der]], [[틀:inh]], [[틀:m]] 등에서 {{{langname}}} 낱말로 링크하는 매개변수가 누락된 항목.",
parents = {"문서 관리"},
can_be_empty = true,
hidden = true,
}
labels["redlinks"] = {
description = "아직 생성되지 않은 {{{langname}}} 항목으로 향하는 링크.",
parents = {"문서 관리"},
catfix = false,
can_be_empty = true,
hidden = true,
}
labels["terms with IPA pronunciation"] = {
description = "IPA 형태로 발음이 포함된 {{{langname}}} 낱말.",
additional = "이 분류와 관련된 요청은 [[:분류:{{{langname}}} 발음 요청]] 문서를 참고하십시오.",
parents = {"문서 관리"},
}
labels["IPA pronunciations with invalid separators"] = {
description = "IPA에 /.ˈ/, /.ˌ/, /' / 또는 /, /와 같이 유효하지 않은 구분 기호를 사용하는 {{{langname}}} 낱말.",
parents = {"문서 관리"},
can_be_empty = true,
hidden = true,
}
labels["terms with hyphenation"] = {
description = "하이픈(-)이 포함된 {{{langname}}} 낱말.",
parents = {"문서 관리"},
}
labels["terms with audio pronunciation"] = {
description = "음성 파일 형태로 발음이 포함된 {{{langname}}} 낱말.",
additional = "이 분류와 관련된 요청은 [[:분류:{{{langname}}} 음성 파일 요청]] 문서를 참고하십시오.",
parents = {"문서 관리"},
}
labels["entries missing Template:reconstructed"] = {
description = "{{틀|reconstructed}} 틀이 없는 재구된 {{{langname}}} 항목.",
parents = {"문서 관리"},
can_be_empty = true,
hidden = true,
}
local function add_manual_param_category(label, desc, addl_intro, include_addl_continuation)
labels[label] = {
description = desc or label .. "을(를) 포함하는 {{{langname}}} 문서.",
additional = addl_intro .. (not include_addl_continuation and "" or "\n\n" ..
"이 분류의 문서가 반드시 해당 낱말 자체의 문서는 아닐 수 있다는 점에 유의하십시오. " ..
"예를 들어, 번역 문단이 있는 한국어 문서에서 분류 추가를 유발하는 낱말이 번역어 중 하나인 경우가 자주 발생합니다."),
parents = {"문서 관리"},
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,
"언어 데이터 목록에 없는 스크립트로 쓰인 낱말을 포함하는 문서가 여기에 분류됩니다. " ..
"이는 해당 스크립트를 목록에 추가해야 하거나, 잘못된 언어 코드가 사용되었음을 의미할 수 있습니다.",
true)
add_manual_param_category("terms with non-redundant manual transliterations", nil,
"{{변수|tr}} 등 매개변수를 사용하여 수동으로 지정된 로마자 표기가 자동 생성된 것과 다른 낱말을 포함하는 문서.",
true)
add_manual_param_category("terms with redundant transliterations", nil,
"{{변수|tr}} 등 매개변수를 사용하여 수동으로 지정된 로마자 표기가 자동 생성된 것과 동일한 낱말을 포함하는 문서.",
true)
add_manual_param_category("terms with non-redundant manual script codes", nil,
"{{변수|sc}} 등 매개변수를 사용하여 수동으로 지정된 스크립트 코드가 자동 생성된 것과 다른 낱말을 포함하는 문서.",
true)
add_manual_param_category("terms with redundant script codes", nil,
"{{변수|sc}} 등 매개변수를 사용하여 수동으로 지정된 스크립트 코드가 자동 생성된 것과 동일한 낱말을 포함하는 문서.",
true)
add_manual_param_category("terms with non-redundant non-automated sortkeys",
"중복되지 않는 수동 정렬 키가 있는 {{{langname}}} 낱말.",
"자동으로 생성된 정렬 키가 아닌 다른 정렬 키를 사용하여 정렬된 낱말이 여기에 분류됩니다. " ..
"이는 두 가지 이유로 발생할 수 있습니다:\n# {{변수|sort}} 매개변수를 사용하여 다른 정렬 키가 지정된 경우.\n" ..
"# 원시 위키텍스트를 사용하여 하나 이상의 분류가 추가된 경우. 이 경우 해당 분류에 대해 문서의 기본 정렬 키가 사용됩니다. " ..
"만약 그 기본 정렬 키가 자동 정렬 키와 다르면, 해당 문서도 여기에 추가됩니다.")
add_manual_param_category("terms with redundant sortkeys",
"중복된 정렬 키가 있는 {{{langname}}} 낱말.",
"{{변수|sort}} 매개변수를 사용하여 정렬 키가 지정되었고, 그것이 자동으로 생성된 것과 동일한 경우 여기에 분류됩니다.")
add_manual_param_category("links with redundant target parameters",
"대체 표시 텍스트가 링크 목표를 대체할 수 있음에도 별도로 주어진 {{{langname}}} 링크를 포함하는 문서.",
"이는 링크 목표와 대체 텍스트의 유일한 차이가, 링크 목표에 포함되었더라도 어차피 무시되었을 발음 구별 기호(또는 다른 문자)를 대체 텍스트가 포함하고 있을 때 발생합니다. " ..
"예를 들어, {{틀|l|la|amo|amō}} ({{l|la|amo|amō}})는 {{틀|l|la|amō}} ({{l|la|amō}})와 정확히 동일합니다. 왜냐하면 라틴어 링크 목표에서는 장음 부호가 자동으로 제거되지만, 표시될 때는 여전히 보이기 때문입니다.")
add_manual_param_category("links with ignored alt parameters",
"{{변수|alt}} 매개변수가 무시된 {{{langname}}} 링크를 포함하는 문서.",
"이는 주 링크 텍스트에 위키링크가 포함될 때 발생합니다.")
add_manual_param_category("links with redundant alt parameters",
"{{변수|alt}} 매개변수가 중복된 {{{langname}}} 링크를 포함하는 문서.",
"이는 대체 텍스트가 출력에 아무런 차이를 만들지 않을 때 발생합니다. 예를 들어, {{틀|l|en|foo|foo}} " ..
"({{l|en|foo|foo}})는 {{틀|l|en|foo}} ({{l|en|foo}})와 정확히 동일합니다.")
add_manual_param_category("links with ignored id parameters",
"{{변수|id}} 매개변수가 무시된 {{{langname}}} 링크를 포함하는 문서.",
"이는 주 링크 텍스트에 위키링크가 포함될 때 발생합니다.")
add_manual_param_category("links with redundant wikilinks",
"중복된 위키링크를 포함하는 {{{langname}}} 링크.",
"이는 링크 목표가 단일 위키링크로 구성될 때 발생하며, 이 경우 링크 괄호 없이 일반적인 방식으로 입력해야 합니다. " ..
"예를 들어, {{틀|l|en|<nowiki>[[foo]]</nowiki>}}는 {{틀|l|en|foo}}와 같고, {{틀|l|en|<nowiki>[[foo|bar]]</nowiki>}}는 " ..
"{{틀|l|en|foo|bar}}와 같습니다.\n\n또한 링크 틀이 불필요하게 중첩될 때도 발생합니다: 예: {{틀|l|en|{{틀|l|en|foo}}}}")
add_manual_param_category("links with manual fragments",
"수동으로 링크 조각(#)이 지정된 {{{langname}}} 링크를 포함하는 문서.",
"이는 용어 뒤에 {{코드|#}}를 사용하여 링크 조각이 지정될 때 발생하며, 이는 관련 언어 문단을 가리키는 링크 틀의 일반적인 조각 생성을 무시합니다.\n\n" ..
"링크 조각은 대상 문서의 특정 문단을 가리키는 데 사용되며, 이 목적을 위해서는 {{변수|id}} 매개변수를 사용하는 것이 더 좋습니다. " ..
"왜냐하면 대상 문서에 추가 내용이 더해져도 망가질 가능성이 적기 때문입니다.")
labels["descendant hubs"] = {
description = "둘 이상의 등재 가치 있는 파생어를 나열하기 위해 존재하는, 부분의 합 이상의 의미를 갖지 않는 {{{langname}}} 낱말.",
parents = {"문서 관리"},
}
labels["terms needing to be assigned to a sense"] = {
description = "{{{langname}}} 항목에서 \"동의어\"나 \"반의어\" 같은 문단 아래에 있으나 특정 의미에 할당되지 않은 낱말. [[틀:syn]]이나 [[틀:ant]]를 사용하여 수정하세요.",
parents = {"문서 관리"},
can_be_empty = true,
hidden = true,
}
--[=[
labels["terms with inflection tables"] = {
description = "{{{langname}}} entries that contain inflection tables.".
additional = "For requests related to this category," see [[:Category:Requests for inflections in {{{langname}}} entries]].",
parents = {"문서 관리"},
}
]=]
labels["terms with collocations"] = {
description = "{{{langname}}} 항목 중 {{틀|co}}와 같은 틀을 사용하여 추가된 [[연어]]를 포함하는 문서.",
additional = "이 분류와 관련된 요청은 [[:분류:{{{langname}}} 연어 요청]]을 참고하십시오. [[:분류:{{{langname}}} 인용 요청]] 및 [[:분류:{{{langname}}} 예문 요청]]도 참고하십시오.",
parents = {"문서 관리"},
}
labels["terms with usage examples"] = {
description = "{{{langname}}} 항목 중 {{틀|ux}}와 같은 틀을 사용하여 추가된 용례를 포함하는 문서.",
additional = "이 분류와 관련된 요청은 [[:분류:{{{langname}}} 예문 요청]]을 참고하십시오. [[:분류:{{{langname}}} 연어 요청]] 및 [[:분류:{{{langname}}} 인용 요청]]도 참고하십시오.",
parents = {"문서 관리"},
}
labels["terms with quotations"] = {
description = "{{{langname}}} 항목 중 {{틀|인용}}, {{틀|책 인용}}, {{틀|학술지 인용}} 등과 같은 틀을 사용하여 추가된 인용문을 포함하는 문서.",
additional = "이 분류와 관련된 요청은 [[:분류:{{{langname}}} 인용 요청]]을 참고하십시오. [[:분류:{{{langname}}} 예문 요청]]도 참고하십시오.",
parents = {"문서 관리"},
}
labels["terms with redundant head parameter"] = {
description = "{{{langname}}} 낱말 중 표제어( {{틀|head}} 또는 언어별 동등한 틀로 호출됨)에 중복된 head= 매개변수를 포함하는 낱말.",
additional = "개별 언어는 `data.no_redundant_head_cat`을 설정하여 낱말이 이 분류에 추가되는 것을 막을 수 있습니다.",
parents = {"문서 관리"},
can_be_empty = true,
hidden = true,
}
labels["terms with red links in their headword lines"] = {
description = "{{{langname}}} 낱말 중 표제어 줄에 빨간 링크(즉, 생성되지 않은 형식)를 포함하는 낱말.",
parents = {"redlinks"},
can_be_empty = true,
hidden = true,
}
labels["terms with red links in their inflection tables"] = {
description = "{{{langname}}} 낱말 중 활용표에 빨간 링크(즉, 생성되지 않은 형식)를 포함하는 낱말.",
parents = {"redlinks"},
can_be_empty = true,
hidden = true,
}
labels["requests for English equivalent term"] = {
description = "{{틀|rfeq}}로 태그된 정의가 있는 {{{langname}}} 항목. 자세한 내용은 틀의 설명 문서를 읽어보십시오.",
parents = {"문서 관리"},
can_be_empty = true,
hidden = true,
}
for _, quot_type in ipairs { "인용", "용례" } do
labels[quot_type .. " with omitted translation"] = {
description = "번역이 필요하지만 {{code|-}}를 지정하여 번역이 명시적으로 생략된 {{{langname}}} " .. quot_type .. ". 번역을 제공해야 합니다.",
parents = {"문서 관리"},
can_be_empty = true,
hidden = true,
}
end
for _, pos in ipairs({"명사", "고유 명사", "동사", "형용사", "부사", "분사", "한정사", "대명사", "수사", "접미사", "축약형"}) do
labels[pos .. " with red links in their headword lines"] = {
description = "표제어 줄에 빨간 링크(즉, 생성되지 않은 형식)를 포함하는 {{{langname}}} " .. pos .. ".",
parents = {"terms with red links in their headword lines"},
breadcrumb = pos,
can_be_empty = true,
hidden = true,
}
labels[pos .. " with red links in their inflection tables"] = {
description = "활용표에 빨간 링크(즉, 생성되지 않은 형식)를 포함하는 {{{langname}}} " .. pos .. ".",
parents = {"terms with red links in their inflection tables"},
breadcrumb = pos,
can_be_empty = true,
hidden = true,
}
end
for _, pos in ipairs { "명사", "고유 명사", "대명사" } do
local label = pos .. " with unknown or uncertain plurals"
labels[label] = {
description = label .. "인 {{{langname}}} 낱말.",
additional = "낱말은 보통 복수형으로 {{code|?}}를 지정하여 이 분류에 추가됩니다. " ..
"가능한 한 복수형을 추가하거나, 명사가 셀 수 없는 경우 적절하게 표시해야 합니다 (보통 복수형 대신 {{code|-}} 사용). " ..
"일부 언어는 복수형을 증명할 수는 없지만 이론적으로 셀 수 있는 명사임을 나타내기 위해 {{code|!}} 값을 지원합니다.",
breadcrumb = "알 수 없거나 불확실한 복수형이 있는",
parents = {
{name = pos, sort = "알 수 없거나 불확실한 복수형"},
"문서 관리",
},
}
end
-- 'umbrella_parents' 키가 없는 경우 추가.
for _, data in pairs(labels) do
if not data.umbrella_parents then
data.umbrella_parents = "언어별 문서 관리 하위 분류"
end
end
-----------------------------------------------------------------------------
-- --
-- 원시(RAW) 분류 --
-- --
-----------------------------------------------------------------------------
raw_categories["언어별 문서 관리 하위 분류"] = {
description = "문서 관리에 관련된 주제를 다루는 포괄 분류.",
additional = "{{{umbrella_meta_msg}}}",
parents = {
"포괄 메타분류",
{name = "문서 관리", is_label = true, sort = " "},
},
}
raw_categories["요청"] = {
topright = "{{바로가기|낱말사전:요청}}",
description = "다양한 요청 분류들의 상위 분류입니다.",
parents = {"분류:위키낱말사전"},
}
raw_categories["언어별 요청"] = {
description = "다양한 특정 언어의 요청이 있는 분류.",
additional = "{{{umbrella_msg}}}",
parents = {
{name = "언어별 요청 하위 분류", sort = " "},
{name = "요청", sort = " "},
},
breadcrumb = "언어별",
}
raw_categories["언어별 요청 하위 분류"] = {
description = "요청 관련 주제를 다루는 포괄 분류.",
additional = "{{{umbrella_meta_msg}}}",
parents = {
"포괄 메타분류",
{name = "요청", sort = " "},
},
}
raw_categories["출처별 인용 요청"] = {
description = "인용 출처별로 세분화된 인용 요청 분류.",
additional = "일부 축약된 출처 이름은 [[위키낱말사전:Webster 약어 출처]]에서 설명합니다.",
parents = {{name = "인용 요청", sort = "출처"}},
breadcrumb = "출처별",
}
raw_categories["인용 요청"] = {
description = "항목에 {{틀|인용 필요}}를 포함하여 이 분류에 낱말을 추가합니다.",
parents = {{name = "요청", sort = "인용"}},
breadcrumb = "인용",
}
raw_categories["날짜 요청"] = {
description = "인용문에 날짜 추가를 요청하는 분류입니다.",
additional = "문서에 날짜를 추가하려면 {{틀|날짜 요청}} 또는 저자를 포함하는 {{틀|날짜 요청자}}를 사용하십시오. " ..
"날짜가 제공되면 문서에서 틀을 제거해주세요.",
parents = {{name = "요청", sort = "날짜"}},
breadcrumb = "날짜",
}
raw_categories["사용자 수별 사용자 역량 분류 번역 요청"] = {
description = "사용자 역량 분류에 번역 추가를 요청하는 분류로, 해당 역량을 가진 사용자 수에 따라 정렬됩니다.",
parents = {{name = "요청", sort = "사용자 수별 사용자 역량 분류 번역 요청"}},
breadcrumb = "사용자 수별 사용자 역량 분류 번역 요청",
}
raw_categories["언어별 사용자 역량 분류 번역 요청"] = {
description = "사용자 역량 분류에 번역 추가를 요청하는 분류로, 언어에 따라 정렬됩니다.",
parents = {{name = "요청", sort = "언어별 사용자 역량 분류 번역 요청"}},
breadcrumb = "언어별 사용자 역량 분류 번역 요청",
hidden = true,
}
raw_categories["언어별 번역이 있는 낱말"] = {
description = "언어별로 정렬된, 번역이 있는 낱말.",
parents = {{name = "언어별 문서 관리 하위 분류", sort = "언어별 번역"}},
breadcrumb = "번역",
}
raw_categories["누락된 학명을 사용하는 항목"] = {
description = "{{틀|taxlink}} 틀에 해당하는 위키낱말사전 항목이 없어 위키생물종으로 링크되는 항목.",
additional = "누락된 이름은 {{틀|taxlink}}에 포함된 하나 이상의 이름입니다. 항목은 누락된 학명으로 정렬됩니다." ..
"\n\n[[:분류:mul:학명]] 문서를 참고하십시오.",
parents = {{name = "문서 관리", is_label = true, lang = "mul", sort = "missing taxonomic names"}},
breadcrumb = "누락된 학명",
hidden = true,
}
-----------------------------------------------------------------------------
-- --
-- RAW HANDLERS --
-- --
-----------------------------------------------------------------------------
local function script_name_to_code(name)
local sc = require(scripts_module).getByCanonicalName(name)
if not sc then
error("Unrecognized script name '" .. name .. "'")
end
return sc:getCode()
end
--[=[
This array consists of category match specs. Each spec contains one or more properties, whose values are (a) strings
that may contain references to other properties using the {{{PROPERTY}}} syntax; (b) functions of one argument, an
`items` table of the same properties that are accessible using the {{{PROPERTY}} syntax. Each such spec should have at
least a `regex` property that matches the name of the category. Capturing groups in this regex can be referenced in
other properties using {{{1}}} for the first group, {{{2}}} for the second group, etc. (or using keys "1", "2", etc. in
functions). Property expansion happens recursively if needed (i.e. a property can reference another property, which in
turn references a third property).
If there is a `language_name` propery, it specifies the language name (and will typically be a reference to a capturing
group from the `regex` property); if not specified, it defaults to "{{{1}}}" unless the `nolang` property is set, in
which case there is no language name associated with the category name. The language name must be the canonical name of
a recognized full language, or an error is thrown; however, if the `allow_etym_lang` property is set, the language name
may also be the canonical name of an etymology-only language. Based on the language name, the `language_code` and
`language_object` properties are automatically filled in. If `language_name` is an etymology-only language, additional
properties `parent_language_name`, `parent_language_code` and `parent_language_object` are set for the parent full
language of the etymology-only language.
If the `regex` values of multiple category specs match, the first one takes precedence.
Recognized or predefined properties:
`pagename`: Current pagename.
`regex`: See above.
`1`, `2`, `3`, ...: See above.
`language_name`, `language_code`, `language_object`: See above.
`parent_language_name`, `parent_language_code`, `parent_language_object`: See above.
`nolang`: See above.
`allow_etym_lang`: Language names may be etymology-only languages. See above.
`description`: Override the description (normally taken directly from the pagename).
`template_name`: Name of template which generates this category.
`template_sample_call`: Syntax for calling the template. Defaults to "{{{template_name}}}|{{{language_code}}}". Used to
display an example template call and the output of this call.
`template_actual_sample_call`: Syntax for calling the template. Takes precedence over `template_sample_call` when
generating example template output (but not when displaying an example template call) and is intended for a template
call that uses the |nocat=1 parameter.
`template_example_output`: Override the text that displays example template output (see `template_sample_call`).
`additional_template_description`: Extra text to be displayed after the example template output.
`parents`: Parent categories. Should be a list of elements, each of which is an object containing at least a name= and
sort= field (same format as parents= for regular raw categories, except that the name= and sort= field will have
{{{PROPERTY}}} references expanded). If no parents are specified, and the pagename is of the form "Requests for FOO
by language", the parent will be "Request subcategories by language" with FOO as the sort key. Otherwise, the
`language_name` property must exist, and the parent will be "Requests concerning LANGNAME", with the pagename minus
any initial "Requests for " as the sort key. Note that this does *NOT* apply if an etymology-only language is
associated with the category, in which case `etym_parents` is used instead.
`etym_parents`: Parent categories for categories with associated etymology-only languages. The format is the same as
`parents`. If omitted, there are two parents by default: (1) The pagename (i.e. category name) with the language name
replaced by the corresponding parent language name, with the value of `language_name` as the sort key; (2) "Requests
concerning LANGNAME", with the pagename minus any initial "Requests for " as the sort key.
`umbrella`: Parent all-language category. Sort key is based on the language name. This applies *ONLY* if a full language
is associated with the category name (i.e. not if `nolang` is set or if `allow_etym_lang` is set and the associated
language is an etymology-only language); otherwise there will be no umbrella category.
`breadcrumb`: Specify the breadcrumb. If `parents` is given, there is no default (i.e. it will end up being the
pagename). Otherwise, if the pagename is of the form "Requests for FOO by language", the default breadcrumb will be
"FOO". Otherwise it is computed by removing the language name from the pagename and chopping out "Requests for" from
the beginning and "in entries" and "for terms" from the end. Note that this does *NOT* apply if an etymology-only
language is associated with the category, in which case `etym_breadcrumb` is used instead.
`etym_breadcrumb`: Specify the breadcrumb for categories with associated etymology-only languages. Defaults to the value
of `language_name`.
`not_hidden_category`: Don't hide the category.
`catfix`: Same as `catfix` in regular labels and raw categories, except that request-specific {{{PROPERTY}}} syntax is
expanded.
`toc_template`, `toc_template_full`: Same as the corresponding fields in regular labels and raw categories, except that
request-specific {{{PROPERTY}}} syntax is expanded.
In general, properties can contain references to templates (e.g. {{tl}} and {{para}}), which will be appropriately
expanded (this expansion happens in the poscatboiler code, not in this module). The major exception is in the
`template_sample_call` and `template_actual_sample_call` properties, which are surrounded by <pre>...</pre> when
inserted, so template references are not expanded. Triple-brace property references are still expanded in these
properties; but beware that if any of those property references contain template references, they won't be expanded.
(This actually happens in the handlers for 'Request for SCRIPT script for LANG terms'; the sample call references
{{{script_code}}}, whose definition therefore cannot contain template references. The solution is to define this
property using a function.)
]=]
local requests_categories = {
{
regex = "^Requests concerning (.+)$",
allow_etym_lang = true,
description = "Categories with {{{1}}} entries that need the attention of experienced editors.",
parents = {{name = "문서 관리", is_label = true, sort = "requests"}},
etym_parents = {{name = "Requests concerning {{{parent_language_name}}}", sort = "{{{1}}}"}},
umbrella = "Requests by language",
breadcrumb = "Requests",
not_hidden_category = true,
},
{
regex = "^Requests for etymologies in (.+) entries$",
allow_etym_lang = true,
umbrella = "Requests for etymologies by language",
template_name = "rfe",
},
{
regex = "^Requests for expansion of etymologies in (.+) entries$",
umbrella = "Requests for expansion of etymologies by language",
template_name = "etystub",
},
{
regex = "^Requests for pronunciation in (.+) entries$",
umbrella = "Requests for pronunciation by language",
template_name = "rfp",
},
{
regex = "^Requests for audio pronunciation in (.+) entries$",
umbrella = "Requests for audio pronunciation by language",
template_name = "rfap",
},
{
regex = "^Requests for definitions in (.+) entries$",
umbrella = "Requests for definitions by language",
template_name = "rfdef",
},
{
regex = "^Requests for clarification of definitions in (.+) entries$",
umbrella = "Requests for clarification of definitions by language",
template_name = "rfclarify",
},
}
for _, spec_with_pos in ipairs {
{"inflections", "rfinfl"},
{"plural forms"},
{"tone", "rftone"},
{"accents"},
{"aspect", "rfaspect"},
{"animacy"},
{"gender", "rfgender"},
{"noun class"},
} do
local property, rftemplate = unpack(spec_with_pos)
table.insert(requests_categories,
{
-- This is for part-of-speech-specific categories such as
-- "Requests for inflections in Northern Ndebele noun entries" or
-- "Requests for accents in Ukrainian proper noun entries".
-- Here and below, we assume that the part of speech is begins with
-- a lowercase letter, while the preceding language name ends in a
-- capitalized word. Note that this entry comes before the
-- following one and takes precedence over it.
regex = ("^Requests for %s in (.-) ([a-z]+[a-z ]*) entries$"):format(property),
parents = {{name = ("Requests for %s in {{{language_name}}} entries"):format(property), sort = "{{{2}}}"}},
umbrella = ("Requests for %s of {{pluralize|{{{2}}}}} by language"):format(property),
breadcrumb = "{{{2}}}",
template_name = rftemplate,
template_sample_call = rftemplate and ("{{%s|{{{language_code}}}|{{{2}}}}}"):format(rftemplate) or nil,
}
)
table.insert(requests_categories,
{
regex = ("^Requests for %s in (.+) entries$"):format(property),
umbrella = ("Requests for %s by language"):format(property),
template_name = rftemplate,
}
)
table.insert(requests_categories,
{
regex = ("^Requests for %s of (.+) by language$"):format(property),
nolang = true,
}
)
end
extend(requests_categories, {
{
regex = "^Requests for example sentences in (.+)$",
umbrella = "Requests for example sentences by language",
template_name = "rfex",
},
{
regex = "^Requests for quotations in (.+)$",
umbrella = "Requests for quotations by language",
template_name = "rfquote",
},
{
regex = "^Requests for translations into (.+)$",
allow_etym_lang = true,
umbrella = "Requests for translations by language",
template_name = "t-needed",
catfix = "en",
},
{
regex = "^Requests for translations of (.+) usage examples$",
allow_etym_lang = true,
umbrella = "Requests for translations of usage examples by language",
template_name = "t-needed",
template_sample_call = "{{t-needed|{{{language_code}}}|usex}}",
template_actual_sample_call = "{{t-needed|{{{language_code}}}|usex|nocat=1}}",
additional_template_description = "The {{tl|ux}}, {{tl|uxi}}, {{tl|ja-usex}} and {{tl|zh-x}} templates automatically add the page to this category if the example is in a foreign language and the translation is missing."
},
{
regex = "^Requests for translations of (.+) quotations$",
allow_etym_lang = true,
umbrella = "Requests for translations of quotations by language",
template_name = "t-needed",
template_sample_call = "{{t-needed|{{{language_code}}}|quote}}",
template_actual_sample_call = "{{t-needed|{{{language_code}}}|quote|nocat=1}}",
additional_template_description = "The {{tl|quote}}, and {{tl|Q}} templates automatically add the page to this category if the example is in a foreign language and the translation is missing."
},
{
regex = "^Requests for review of (.+) translations$",
allow_etym_lang = true,
umbrella = "Requests for review of translations by language",
template_name = "t-check",
template_sample_call = "{{t-check|{{{language_code}}}|example}}",
template_example_output = "",
catfix = "en",
},
{
regex = "^Requests for transliteration of (.+) terms$",
umbrella = "Requests for transliteration by language",
template_name = "rftranslit",
additional_template_description = "The {{tl|head}} template, and the large number of language-specific variants of it, automatically add " ..
"the page to this category if the example is in a foreign language and no transliteration can be generated (particularly in languages without " ..
"automated transliteration, such as Hebrew and Persian).",
},
{
regex = "^Requests for transliteration of (.+) usage examples$",
umbrella = "Requests for transliteration of usage examples by language",
template_name = "rftranslit",
template_sample_call = "{{rftranslit|{{{language_code}}}|usex=1}}",
template_actual_sample_call = "{{rftranslit|{{{language_code}}}|usex=1|nocat=1}}",
catfix = false,
additional_template_description = "The {{tl|ux}} and {{tl|uxi}} templates automatically add the page to this category if the example " ..
"is in a foreign language and no transliteration can be generated (particularly in languages without automated transliteration, such as " ..
"Hebrew and Persian).",
},
{
regex = "^Requests for transliteration of (.+) quotations$",
umbrella = "Requests for transliteration of quotations by language",
catfix = false,
additional_template_description = "The {{tl|quote}} and {{code|<nowiki>{{quote-*}}</nowiki>}} templates automatically add the page to this category if the quotation " ..
"is in a foreign language and no transliteration can be generated (particularly in languages without automated transliteration, such as " ..
"Hebrew and Persian).",
},
{
regex = "^Requests for native script for (.+) terms$",
allow_etym_lang = true,
etym_parents = {
{name = "Requests for native script for {{{parent_language_name}}} terms", sort = "{{{1}}}"},
{name = "Requests concerning {{{language_name}}}", sort = "native script"},
},
umbrella = "Requests for native script by language",
template_name = "rfscript",
template_actual_sample_call = "{{rfscript|{{{language_code}}}|nocat=1}}",
catfix = false,
additional_template_description = "Many templates such as {{tl|l}}, {{tl|m}} and {{tl|t}} automatically place the page in this category when they are missing the term but have been provided with a transliteration."
},
{
regex = "^Requests for native script in (.+) usage examples$",
umbrella = "Requests for native script in usage examples by language",
template_name = "rfscript",
template_sample_call = "{{rfscript|{{{language_code}}}|usex=1}}",
template_actual_sample_call = "{{rfscript|{{{language_code}}}|usex=1|nocat=1}}",
catfix = false,
additional_template_description = "The {{tl|ux}} and {{tl|uxi}} templates automatically add the page to this category if the example itself is missing but the translation is supplied."
},
{
regex = "^Requests for native script in (.+) quotations$",
umbrella = "Requests for native script in quotations by language",
template_name = "rfscript",
template_sample_call = "{{rfscript|{{{language_code}}}|quote=1}}",
template_actual_sample_call = "{{rfscript|{{{language_code}}}|quote=1|nocat=1}}",
catfix = false,
additional_template_description = "The {{tl|quote}} and {{code|<nowiki>{{quote-*}}</nowiki>}} templates automatically add the page to this category if the quotation itself is missing but the translation is supplied."
},
{
regex = "^Requests for (.+) script for (.+) terms$",
language_name = "{{{2}}}",
allow_etym_lang = true,
parents = {{name = "Requests for native script for {{{language_name}}} terms", sort = "{{{1}}}"}},
etym_parents = {
{name = "Requests for native script for {{{language_name}}} terms", sort = "{{{1}}}"},
{name = "Requests for {{{1}}} script for {{{parent_language_name}}} terms", sort = "{{{language_name}}}"},
{name = "Requests concerning {{{language_name}}}", sort = "{{{1}}} script"},
},
umbrella = "Requests for {{{1}}} script by language",
breadcrumb = "{{{1}}}",
etym_breadcrumb = "{{{1}}}",
template_name = "rfscript",
-- NOTE: The following is used in `template_sample_call` and `template_actual_sample_call`, meaning the
-- conversion of script name to script code needs to be done using an inline function like this, instead of
-- a {{#invoke:...}} template call.
script_code = function(items)
return script_name_to_code(items["1"])
end,
template_sample_call = "{{rfscript|{{{language_code}}}|sc={{{script_code}}}}}",
template_actual_sample_call = "{{rfscript|{{{language_code}}}|sc={{{script_code}}}|nocat=1}}",
catfix = false,
additional_template_description = "Many templates such as {{tl|l}}, {{tl|m}} and {{tl|t}} automatically place the page in this category when they are missing the term but have been provided with a transliteration."
},
{
regex = "^Requests for (.+) script by language$",
parents = {{name = "Requests for script by language", sort = "{{{1}}}"}},
breadcrumb = "{{{1}}}",
nolang = true,
},
{
regex = "^Requests for script by language$",
nolang = true,
},
{
regex = "^Requests for images in (.+) entries$",
umbrella = "Requests for images by language",
template_name = "rfi",
},
{
regex = "^Requests for references for (.+) terms$",
umbrella = "Requests for references by language",
template_name = "rfref",
},
{
regex = "^Requests for references for etymologies in (.+) entries$",
parents = {{name = "Requests for references for {{{language_name}}} terms", sort = "etymologies"}},
umbrella = "Requests for references for etymologies by language",
breadcrumb = "Etymologies",
template_name = "rfv-etym",
},
{
regex = "^Requests for references for pronunciations in (.+) entries$",
parents = {{name = "Requests for references for {{{language_name}}} terms", sort = "pronunciations"}},
umbrella = "Requests for references for pronunciations by language",
breadcrumb = "Pronunciations",
template_name = "rfv-pron",
},
{
regex = "^Requests for attention concerning (.+)$",
umbrella = "Requests for attention by language",
breadcrumb = "Attention",
template_name = "attention",
template_sample_call = "{{attention|{{{language_code}}}|insert a brief description of the request here}}",
template_example_output = "This template does not generate any text in entries, but can be visualised by enabling the Catch My Attention gadget. See {{section link|Template:attention#Visibility}}.",
-- These pages typically contain a mixture of English and native-language entries, so disable catfix.
catfix = false,
-- Setting catfix = false will normally trigger the English table of contents template.
-- We still want the native-language table of contents template, though.
toc_template = "{{{language_code}}}-categoryTOC",
toc_template_full = "{{{language_code}}}-categoryTOC/full",
},
{
regex = "^Requests for cleanup in (.+) entries$",
umbrella = "Requests for cleanup by language",
template_name = "rfc",
template_actual_sample_call = "{{rfc|{{{language_code}}}|nocat=1}}",
},
{
regex = "^Requests for cleanup of Pronunciation N headers in (.+) entries$",
umbrella = "Requests for cleanup of Pronunciation N headers by language",
template_name = "rfc-pron-n",
template_actual_sample_call = "{{rfc-pron-n|{{{language_code}}}|nocat=1}}",
template_example_output = "This template does not generate any text in entries.",
additional_template_description = [=[
The purpose of this category is to tag entries that use headers with "Pronunciation" and a number.
While these headers and structure are sometimes used, they are not specifically prescribed by [[WT:ELE]]. No complete proposal has yet been made on how they should work, what the semantics are, or how they interact with multiple etymologies. As a result they should generally be avoided. Instead, merge the entries (possibly under multiple Etymology sections, if appropriate), and list all pronunciations, appropriately tagged, under a Pronunciation header.
[[User:KassadBot|KassadBot]] tags these entries (or used to tag these entries, when the bot was operational). At some point if a proposal is made and adopted as policy, these entries should be reviewed.
This category is hidden.]=],
},
{
regex = "^Requests for deletion in (.+) entries$",
umbrella = "Requests for deletion by language",
template_name = "rfd",
template_actual_sample_call = "{{rfd|{{{language_code}}}|nocat=1}}",
},
{
regex = "^Requests for verification in (.+) entries$",
umbrella = "Requests for verification by language",
template_name = "rfv",
},
{
regex = "^Requests for attention in (.+) etymologies$",
umbrella = "Requests for attention by language"
},
{
regex = "^Requests for quotations/(.+)$",
description = "Requests for a quotation or for quotations from {{{1}}}.",
parents = {{name = "Requests for quotations by source", sort = "{{{1}}}"}},
breadcrumb = "{{{1}}}",
nolang = true,
template_name = "rfquotek",
template_sample_call = "{{rfquotek|LANGCODE|{{{1}}}}}",
template_example_output = "\n(where LANGCODE is the language code of the entry)\n\nIt results in the message below:\n\n{{rfquotek|und|{{{1}}}}}",
},
{
regex = "^Requests for date in (.+) entries$",
umbrella = "Requests for date by language",
template_name = "rfdate",
additional_template_description = "The quotation templates, such as {{tl|quote-book}} and {{tl|quote-journal}}, " ..
"automatically add the page to this category if neither {{para|date}} nor {{para|year}} is provided. Providing the " ..
"parameter in each case on the page automatically removes the article from this category. See " ..
"[[Wiktionary:Quotations]] for information about formatting dates and quotations.",
},
{
regex = "^Requests for date/(.+)$",
description = "{{rfd|section=Category:Requests for date by source}}Requests for a date for a quotation or quotations from {{{1}}}.",
parents = {{name = "Requests for date by source", sort = "{{{1}}}"}},
breadcrumb = "{{{1}}}",
nolang = true,
template_name = "rfdatek",
template_sample_call = "{{rfdatek|LANGCODE|{{{1}}}}}",
template_example_output = "\n(where LANGCODE is the language code of the entry)\n\nIt results in the message below:\n\n{{rfdatek|und|{{{1}}}}}",
},
{
regex = "^Requests for attestation of (.+) terms$",
umbrella = "Requests for attestation of terms by language",
breadcrumb = "Attestation",
additional_template_description = "The {{tl|LDL}} template adds this category when a language code is supplied in {{para|1}} (as it should be)."
},
})
local user_competency_additional_template_description = "This is added by user-competency categories such as " ..
"[[:Category:User fr-4]], which groups users who speak French at level 4 (near-native proficiency), when " ..
"the native-language text indicating this fact is missing. The appropriate translation should mirror the " ..
"English text also displayed (e.g. in this case \"These users speak French at a '''near native''' " ..
"level.\"), and should be supplied to {{tl|auto cat}} using the {{para|text}} parameter. The mention of the " ..
"language in the text should be surrounded by double angle brackets, e.g. \"<<français>>\", which " ..
"causes it to be automatically linked to the appropriate parent category."
local user_competency_parents = {{name = "사용자 수별 사용자 능력 분류 번역 요청",
sort = function(items)
return " " .. ("%010d"):format(items["1"])
end,
}}
extend(requests_categories, {
{
regex = "^사용자 ([0-9]+)%-([0-9]+)명인 사용자 능력 분류 번역 요청$",
description = "{{{1}}}-{{{2}}}명의 사용자를 포함하는 분류에 대해, 특정 언어와 능력 수준에 따른 사용자 능력 설명 문구의 번역 요청입니다.",
additional_template_description = user_competency_additional_template_description,
parents = user_competency_parents,
breadcrumb = "{{{1}}}-{{{2}}}",
nolang = true,
},
{
regex = "^사용자 ([0-9]+)명인 사용자 능력 분류 번역 요청$",
description = "{{{1}}}명의 사용자를 포함하는 분류에 대해, 특정 언어와 능력 수준에 따른 사용자 능력 설명 문구의 번역 요청입니다.",
additional_template_description = user_competency_additional_template_description,
parents = user_competency_parents,
breadcrumb = "{{{1}}}",
nolang = true,
}
})
table.insert(raw_handlers, function(data)
local items
local function init_items()
items = {pagename = data.category}
end
local function expand_value(item, val)
if not val then
return val
elseif is_callable(val) then
return expand_value(item .. " ⇒ function", val(items))
elseif type(val) == "table" then
for k, v in pairs(val) do
val[k] = expand_value(item .. " ⇒ " .. k, v)
end
return val
elseif type(val) == "number" then
val = tostring(val)
end
if type(val) ~= "string" then
error(("The item '%s' on page %s is of type %s and can't be concatenated"):format(
item, items.pagename, type(val)))
end
-- Replaces pseudo-template code {{{ }}} with the corresponding member of the "items" table. Has to be done
-- recursively, since some of the items are nested:
-- {{{template_sample_call_with_temp}}}
-- ⇓
-- {{{{{template_name}}}|{{{language_code}}}}}
-- ⇓
-- {{attention|en}}
if val:find("{{{") then
val = mw.ustring.gsub(val, "{{{([^%}%{]+)}}}", function(prop)
local propval = items[prop]
if not propval then
error(("The item '%s' (expanded from property '%s' on page %s) was not found in the 'items' table"):
format(prop, item, items.pagename))
end
return expand_value(item .. " ⇒ " .. prop, propval)
end
)
end
return val
end
local function expand_items_value(item)
return expand_value(item, items[item])
end
local function convert_items_to_category_data(items)
if not items.nolang then
items.language_name = items.language_name or "{{{1}}}"
items.language_name = expand_items_value("language_name")
items.language_object = require(languages_module).getByCanonicalName(items.language_name, true,
items.allow_etym_lang)
items.language_code = items.language_object:getCode()
items.is_etym_lang = items.language_object:hasType("etymology-only")
if items.is_etym_lang then
items.parent_language_object = items.language_object:getFull()
-- Reject weird cases where etymology language has no parent.
if not items.parent_language_object then
return nil
end
items.parent_language_code = items.parent_language_object:getCode()
items.parent_language_name = items.parent_language_object:getCanonicalName()
-- Reject weird cases where the parent language has the same name as the child etymology language. In
-- that case, we'll get an infinite parent-category loop. This actually happens, e.g. with Rudbari and
-- Bashkardi.
if items.parent_language_name == items.language_name then
return nil
end
else
end
end
if items.template_name then
items.template_sample_call = items.template_sample_call or "{{{{{template_name}}}|{{{language_code}}}}}"
items.full_text_about_the_template = "To make this request, in this specific language, use this code in the entry (see also the documentation at [[Template:{{{template_name}}}]]):\n\n<pre>{{{template_sample_call}}}</pre>"
if items.template_example_output then
items.full_text_about_the_template = items.full_text_about_the_template .. " " .. items.template_example_output
else
items.template_actual_sample_call = items.template_actual_sample_call or items.template_sample_call
items.full_text_about_the_template = items.full_text_about_the_template .. "\nIt results in the message below:\n\n{{{template_actual_sample_call}}}"
end
if items.additional_template_description then
items.full_text_about_the_template = items.full_text_about_the_template .. "\n\n" .. items.additional_template_description
end
else
items.full_text_about_the_template = items.additional_template_description
end
local parents, breadcrumb
if items.is_etym_lang then
parents = items.etym_parents
breadcrumb = expand_items_value("etym_breadcrumb") or items.language_name
else
parents = items.parents
breadcrumb = expand_items_value("breadcrumb")
end
if parents then
for _, parent in ipairs(parents) do
parent.name = expand_value("parent.name", parent.name)
parent.sort = {sort_base = expand_value("parent.sort", parent.sort), lang = "en"}
end
else
local umbrella_type = items.pagename:match("^Requests for (.+) by language$")
if umbrella_type then
breadcrumb = breadcrumb or umbrella_type
parents = {{name = "Request subcategories by language", sort = umbrella_type}}
elseif not items.language_name then
error("Internal error: Don't know how to compute parents for non-language-specific category '" .. items.pagename .. "'")
else
local requests_concerning_breadcrumb = items.pagename:gsub(" " .. pattern_escape(items.language_name), "")
requests_concerning_breadcrumb =
requests_concerning_breadcrumb:gsub("^Requests for ", ""):gsub(" in entries$", ""):gsub(" for terms$", "")
local requests_concerning_parent =
{
name = "Requests concerning " .. items.language_name,
sort = {sort_base = requests_concerning_breadcrumb, lang = "en"}
}
if items.is_etym_lang then
local parent_lang_cat = items.pagename:gsub(pattern_escape(items.language_name), replacement_escape(items.parent_language_name))
parents = {
{name = parent_lang_cat, sort = {sort_base = items.language_name, lang = "en"}},
requests_concerning_parent
}
else
breadcrumb = breadcrumb or requests_concerning_breadcrumb
parents = {requests_concerning_parent}
end
end
end
if not items.nolang and not items.is_etym_lang and items.umbrella ~= false then
table.insert(parents, {
name = expand_items_value("umbrella"),
sort = {sort_base = items.language_name, lang = "en"}
})
end
local additional = expand_items_value("full_text_about_the_template")
if items.pagename:find(" by language$") then
additional = "{{{umbrella_msg}}}" .. (additional and "\n\n" .. additional or "")
end
return {
description = expand_items_value("description") or items.pagename .. ".",
lang = items.parent_language_code or items.language_code,
additional = additional,
parents = parents,
-- If no breadcrumb= and not an etym-only language, it will default to the category name
breadcrumb = breadcrumb,
catfix = expand_items_value("catfix"),
toc_template = expand_items_value("toc_template"),
toc_template_full = expand_items_value("toc_template_full"),
hidden = not items.nolang and not items.not_hidden_category,
can_be_empty = true,
}
end
-- First look for a regular (usually language or script-specific) category.
for _, category in ipairs(requests_categories) do
local matchvals = {mw.ustring.match(data.category, category.regex)}
if #matchvals > 0 then
init_items()
for key, value in pairs(category) do
items[key] = value
end
for key, value in ipairs(matchvals) do
items["" .. key] = value
end
local catdata = convert_items_to_category_data(items)
if catdata then
return catdata
end
end
end
-- Now look for umbrella categories.
for _, category in ipairs(requests_categories) do
if data.category == category.umbrella then
init_items()
items.nolang = true
local catdata = convert_items_to_category_data(items)
if catdata then
return catdata
end
end
end
return nil
end)
table.insert(raw_handlers, function(data)
local langname = data.category:match("^Terms with (.+) translations$")
local lang = langname and require(languages_module).getByCanonicalName(langname, true, true)
if lang then
lang = lang:getCode()
return {
description = "Entries that contain translations into " .. langname .. " which were added using one of the translation templates, such as {{tl|t|" .. lang .. "|...}}, {{tl|t+|" .. lang .. "|...}}, etc.",
parents = {
{name = "문서 관리", is_label = true, lang = lang, sort = "translations"},
{
name = "Terms with translations by language",
sort = {sort_base = langname, lang = "en"}
},
},
breadcrumb = "Translations",
catfix = false,
can_be_empty = true,
hidden = true,
}
end
end)
local recognized_taxtypes = require(table_module).listToSet {
"ambiguous",
"binomial",
"branch",
"clade",
"cladus",
"class",
"cohort",
"convariety",
"cultivar group",
"cultivar",
"division",
"empire",
"epifamily",
"epithet",
"family",
"form taxon",
"form",
"genus",
"grade",
"grandorder",
"group",
"hybrid",
"informal group",
"infraclass",
"infracohort",
"infrakingdom",
"infraorder",
"infraphylum",
"infraspecies",
"kingdom",
"magnorder",
"megacohort",
"mirorder",
"morph",
"nothogenus",
"nothospecies",
"nothosubspecies",
"nothovariety",
"obsolete",
"oofamily",
"order",
"parvclass",
"parvorder",
"phylum",
"section",
"series",
"serovar",
"species group",
"species",
"stem",
"stirps",
"strain",
"subclass",
"subcohort",
"subdivision",
"subfamily",
"subgenus",
"subgroup",
"subinfraorder",
"subkingdom",
"suborder",
"subphylum",
"subsection",
"subspecies",
"subterclass",
"subtribe",
"superclass",
"supercohort",
"superfamily",
"supergroup",
"superorder",
"superphylum",
"supertribe",
"taxon",
"tribe",
"trinomial",
"undescribed species",
"unknown",
"unranked group",
"variety",
"virus complex",
}
table.insert(raw_handlers, function(data)
local taxtype = data.category:match("^Entries using missing taxonomic name %((.*)%)$")
if taxtype and recognized_taxtypes[taxtype] then
return {
description = "Entries that link to wikispecies because there is no corresponding Wiktionary entry for the taxonomic name in the template {{tl|taxlink}}.",
additional = "The missing name is one or more of those enclosed in {{tl|taxlink}}. The entries are sorted by the missing taxonomic name.",
parents = {{name = "Entries using missing taxonomic names", sort = {sort_base = taxtype, lang = "en"}}},
breadcrumb = taxtype,
hidden = true,
}
end
end)
return {LABELS = labels, RAW_CATEGORIES = raw_categories, RAW_HANDLERS = raw_handlers}