มอดูล:category tree/topic cat/data/ชื่อ (หัวข้อ)

local labels = {}
local handlers = {}

labels["ชื่อ (หัวข้อ)"] = {
	type = "related-to",
	description = "{{{langname}}} names for a variety of things.",
	additional = "Given names and surnames can be found in [[:Category:Names by language]].",
	parents = {"หัวข้อทั้งหมด"},
}
labels["names"] = labels["ชื่อ (หัวข้อ)"]

labels["ชื่อตัวอักษร"] = {
	type = "name",
	description = "{{{langname}}} terms that are the names of letters.",
	additional = "Ideally entries should be in a subcategory for the names of letters in a particular script.",
	parents = {"ชื่อ (หัวข้อ)", "ตัวอักษร สัญลักษณ์ และเครื่องหมายวรรคตอน"},
}
labels["letter names"] = labels["ชื่อตัวอักษร"]

-- Handler for "SCRIPT letter names".
table.insert(handlers, function(label)
	local script = mw.ustring.match(label, "^ชื่อตัวอักษร(.*)$")
	if script then
		local sc = require("Module:scripts").getByCanonicalName(script)
		if sc then
			local script_page
			local appendix = ("ภาคผนวก:อักษร%s"):format(script)
			local appendix_title = mw.title.new(appendix)
			if appendix_title and appendix_title.exists then
				script_page = appendix
			else
				script_page = "w:" .. sc:getWikipediaArticle()
			end
			local link = ("[[%s|อักษร%s]]"):format(script_page, script)
			return {
				type = "name",
				description = ("{{{langname}}} terms that serve as names for letters and symbols directly based on letters, " ..
					"such as [[ligature]]s and letters with [[diacritic]]s, of the %s."):format(link),
				parents = {"ชื่อตัวอักษร"},
			}
		end
	end
end)


labels["couple nicknames"] = {
	type = "name",
	description = "{{{langname}}} informal names for pairs of people, especially [[celebrity]] [[couple]]s.",
	additional = "For fictional relationships, see [[:Category:Ships (fandom)]].",
	parents = {"ชื่อเล่น", "บุคคล"},
}

labels["country nicknames"] = {
	type = "name",
	description = "{{{langname}}} informal names for [[country|countries]].",
	parents = {"ชื่อเล่น", "ประเทศ"},
}

labels["foreign personal names"] = {
	type = "name",
	description = "Transliterations, respellings or other renderings of personal names into {{{langname}}}.",
	umbrella = {
		description = "Transliterations, respellings or other renderings of personal names.",
	},
	parents = {"ชื่อ (หัวข้อ)"},
}

labels["named prayers"] = {
	type = "name",
	description = "=[[specific]] [[prayer]]s",
	parents = {"ชื่อ (หัวข้อ)", "prayer"},
}

labels["named roads"] = {
	type = "name",
	description = "=[[individually]]-[[named]] [[roads]]",
	parents = {"ชื่อ (หัวข้อ)", "ถนน"},
}

labels["ชื่อเล่น"] = {
	type = "name",
	description = "{{{langname}}} terms that are informal names or diminutives of specific entities (people, places, etc.)",
	parents = {"ชื่อ (หัวข้อ)"},
}
labels["nicknames"] = labels["ชื่อเล่น"]

labels["nicknames of individuals"] = {
	type = "name",
	description = "{{{langname}}} terms that are informal names for specific individuals (e.g. [[J-Lo]] for singer {{w|Jennifer Lopez}}).",
	parents = {"ปัจเจกบุคคล", "ชื่อเล่น"},
}

labels["racist names for countries"] = {
	type = "name",
	description = "{{{langname}}} racist names for [[country|countries]].",
	parents = {"country nicknames", "racist names for places"},
}

labels["racist names for places"] = {
	type = "name",
	description = "{{{langname}}} racist names for places.",
	parents = {"ชื่อเล่น"},
}

labels["ชื่ออนุกรมวิธาน"] = {
	type = "name",
	description = "default",
	parents = {"ชื่อ (หัวข้อ)", "อนุกรมวิธาน"},
}
labels["taxonomic names"] = labels["ชื่ออนุกรมวิธาน"]

return {LABELS = labels, HANDLERS = handlers}