본문으로 이동

모듈:category tree/transliterations

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

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

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



-----------------------------------------------------------------------------
--                                                                         --
--                                  레이블                                 --
--                                                                         --
-----------------------------------------------------------------------------


labels["romanizations"] = {
	description = "라틴 문자로 음역된 {{{langname}}} 낱말.",
	parents = {"non-lemma forms"},
	umbrella_parents = "언어별 음역 하위 분류",
	-- 로마자 표기 페이지는 언어의 일반 문자가 아닌, 언어별 로마자 표기법에 따른 라틴 문자 낱말을 담고 있으므로
	-- 특별한 로마자 표기 전용 목차(TOC) 바가 사용됩니다 (예: [[틀:got-rom-categoryTOC]]).
	-- 같은 이유로, 스크립트별 글꼴 서식을 비활성화하기 위해 catfix = false를 지정합니다.
	toc_template = {"{{{langcode}}}-rom-categoryTOC", "en-categoryTOC"},
	toc_template_full = {"{{{langcode}}}-rom-categoryTOC/full", "{{{langcode}}}-rom-categoryTOC", "en-categoryTOC/full"},
	catfix_sc = "Latn",
}

labels["romanizations without a main entry"] = {
	description = "해당 언어의 일반 문자로 된 항목이 존재하지 않는 {{{langname}}} 로마자 표기. 해당하는 경우 <code>{{[[틀:로마자 음역|로마자 음역]]}}</code>에 의해 자동으로 추가됩니다.",
	parents = {"entry maintenance", {name = "romanizations", sort = " "}},
	umbrella_parents = "언어별 문서 관리 하위 분류",
	-- 위 'romanizations' 참고.
	toc_template = {"{{{langcode}}}-rom-categoryTOC", "en-categoryTOC"},
	toc_template_full = {"{{{langcode}}}-rom-categoryTOC/full", "{{{langcode}}}-rom-categoryTOC", "en-categoryTOC/full"},
	catfix_sc = "Latn",
	can_be_empty = true,
	hidden = true,
}

labels["terms transliterated from other languages"] = {
	description = "다른 언어에서 음역된 {{{langname}}} 낱말.",
	parents = {{name = "borrowed terms", sort = " "}},
	umbrella_parents = "언어별 음역 하위 분류",
}

labels["arabicizations"] = {
	description = "아랍 아브자드로 음역된 {{{langname}}} 낱말.",
	parents = {"non-lemma forms"},
	umbrella_parents = "언어별 음역 하위 분류",
	toc_template = {"{{{langcode}}}-arab-categoryTOC", "en-categoryTOC"},
	toc_template_full = {"{{{langcode}}}-arab-categoryTOC/full", "{{{langcode}}}-arab-categoryTOC", "en-categoryTOC/full"},
	catfix_sc = "Arab",
}

labels["arabicizations without a main entry"] = {
	description = "해당 언어의 일반 문자로 된 항목이 존재하지 않는 {{{langname}}} 아랍 문자 음역. 해당하는 경우 <code>{{[[틀:아랍 문자 음역|아랍 문자 음역]]}}</code>에 의해 자동으로 추가됩니다.",
	parents = {"entry maintenance", {name = "arabicizations", sort = " "}},
	umbrella_parents = "언어별 문서 관리 하위 분류",
	toc_template = {"{{{langcode}}}-arab-categoryTOC", "en-categoryTOC"},
	toc_template_full = {"{{{langcode}}}-arab-categoryTOC/full", "{{{langcode}}}-arab-categoryTOC", "en-categoryTOC/full"},
	catfix_sc = "Arab",
	can_be_empty = true,
	hidden = true,
}

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

raw_categories["언어별 음역 하위 분류"] = {
	description = "음역과 관련된 주제를 다루는 포괄 분류.",
	additional = "{{{umbrella_meta_msg}}}",
	parents = {
		"포괄 메타분류",
		{name = "언어별 어원 하위 분류", sort = " "},
	},
}

-----------------------------------------------------------------------------
--                                                                         --
--                                  핸들러                                 --
--                                                                         --
-----------------------------------------------------------------------------


table.insert(handlers, function(data)
	-- "transliterations of ... terms" -> "... 낱말의 음역" 패턴으로 변경
	local source_name = data.label:match("^(.+) 낱말의 음역$")
	if not source_name then
		return
	end
	local source = require("Module:languages").getByCanonicalName(source_name, true, true, true)
	if source_name ~= source:getCanonicalName() then
		return
	end
	local display_form = source:getDisplayForm()
	local source_desc = source:makeCategoryLink()
	return {
		description = source_desc .. "에서 음역된 {{{langname}}} 낱말.",
		breadcrumb = display_form,
		parents = {
			{ name = "terms transliterated from other languages", sort = display_form },
			{ name = "terms borrowed from " .. display_form, sort = " "},
		},
		umbrella = {
			no_by_language = true,
			parents = {
				{ name = "terms borrowed from " .. display_form, is_label = true, sort = " " }
			}
		},
	}
end)

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