Modul:category tree/poscatboiler/data/lang-specific/fi

This module handles generating the descriptions and categorization for Finland category pages of the format "Finland LABEL" where LABEL can be any text. Examples are Category:Bulgarian conjugation 2.1 verbs and Category:Russian velar-stem neuter-form nouns. This module is part of the poscatboiler system, which is a general framework for generating the descriptions and categorization of category pages.

For more information, see Module:category tree/poscatboiler/data/lang-specific/documentation.

NOTE: If you add a new language-specific module, you must add the language code to the list at the top of Module:category tree/poscatboiler/data/lang-specific in order for the module to be recognized.


local labels = {}
local handlers = {}

------- Nominal categories -------

labels["nominal mengikut deklensi"] = {
	description = "Kata nama dan kata sifat bahasa {{{langname}}} mengikut jenis deklensi.",
	breadcrumb = "mengikut deklensi",
	preceding = "{{mainapp|Deklensi bahasa Finland}}",
	parents = {
		{name = "kata nama", sort = "deklensi"},
		{name = "kata sifat", sort = "deklensi"},
	},
}

table.insert(handlers, function(data)
	local nomtype = data.label:match("^(.*)%-type nominals$")
	if nomtype then
		return {
			description = ("{{{langname}}} ''%s''-type nominals."):format(nomtype),
			preceding = ("{{mainapp|Finnish declension/%s}}"):format(nomtype),
			breadcrumb = {name = ("''%s''-type"):format(nomtype), nocap = true},
			parents = {"nominal mengikut deklensi"},
		}
	end
end)

------- Verbal categories -------

labels["kata kerja mengikut konjugasi"] = {
	description = "Kata kerja bahasa {{{langname}}} mengikut jenis konjugasi.",
	breadcrumb = "mengikut konjugasi",
	preceding = "{{mainapp|Konjugasi bahasa Finland}}",
	parents = {
		{name = "kata kerja", sort = "konjugasi"},
	},
}

labels["kata kerja tanpa jenis konjugasi"] = {
	description = "Kata kerja bahasa {{{langname}}} yang ketiadaan jenis konjugasi.",
	parents = {"penyelenggaraan entri"},
	hidden = true,
	can_be_empty = true,
}

local ordinal_to_number = {
	first = 1,
	second = 2,
	third = 3,
	fourth = 4,
	fifth = 5,
}

for ordinal, number in pairs(ordinal_to_number) do
	labels[ordinal .. " infinitives"] = {
		description = "{{{langname}}} " .. ordinal .. " infinitives.",
		breadcrumb = ordinal,
		parents = {{name = "infinitives", sort = number}},
		can_be_empty = true,
	}
	labels["long first infinitives"] = {
		description = "{{{langname}}} long first infinitives.",
		additional = "See [[Appendix:Finnish verb forms#First infinitive|this appendix]] for more information.",
		breadcrumb = "long first",
		parents = {{name = "infinitives", sort = 1}},
	}
	labels["active " .. ordinal .. " infinitives"] = {
		description = "{{{langname}}} active " .. ordinal .. " infinitives.",
		breadcrumb = "active",
		parents = {ordinal .. " infinitives"},
	}
	labels["passive " .. ordinal .. " infinitives"] = {
		description = "{{{langname}}} passive " .. ordinal .. " infinitives.",
		breadcrumb = "passive",
		parents = {ordinal .. " infinitives"},
	}
end

labels["kata kerja mengikut aspek"] = {
	description = "Kata kerja bahasa {{{langname}}} mengikut aspek.",
	breadcrumb = "mengikut aspek",
	preceding = "{{mainapp|Aspek kata kerja bahasa Finland}}",
	parents = {
		{name = "kata kerja", sort = "aspek"},
	},
}

local aspect_spec = {
	{"automative", see_also = {"reflexive", "translative"}},
	{"captative"},
	{"causative", see_also = {"curative", "factive"}},
	{"continuative", see_also = {"frequentative"}},
	{"curative", see_also = {"causative", "factive"}, parent = "causative verbs"},
	{"factive", see_also = {"causative", "curative"}},
	{"frequentative", see_also = {"continuative"}},
	{"momentane"},
	{"reflexive"},
	{"semelfactive"},
	{"translative"},
}

for _, spec in ipairs(aspect_spec) do
	local spectype = spec[1]
	local capfirst = mw.getContentLanguage():ucfirst(spectype)
	local additional
	local parents = {}
	if spec.see_also then
		local additional_cats = {}
		for _, other_aspect in ipairs(spec.see_also) do
			table.insert(additional_cats, ("* [[:Category:Finnish %s verbs]]\n"):format(other_aspect))
		end
		additional = "See also:\n" .. table.concat(additional_cats)
	end
	if spec.parent then
		table.insert(parents, spec.parent)
	end
	table.insert(parents, "kata kerja mengikut aspek")
	labels[spectype .. " verbs"] = {
		description = ("{{{langname}}} %s verbs."):format(spectype),
		preceding = ("{{also|[[Appendix:Finnish verb aspects#%s|Appendix:Finnish verb aspects § %s]]}}"):format(
			capfirst, capfirst),
		additional = additional,
		breadcrumb = spectype,
		parents = parents,
	}
end

local defective_types = {
	["kaikaa"] = true,
}

table.insert(handlers, function(data)
	local verbtype = data.label:match("^(.*)%-type verbs$")
	if verbtype then
		local parents = {"kata kerja mengikut konjugasi"}
		local addl
		if defective_types[verbtype] then
			table.insert(parents, "defective verbs")
		end
		if verbtype == "kumajaa" then
			addl = "Some ''rohkaista'' -type verbs have a partially alternative conjugation, which is regarded as a poetic variant to the main conjugation. This category contains the entries where this alternative conjugation is indicated to exist."
		end
		return {
			description = ("{{{langname}}} ''%s''-type verbs."):format(verbtype),
			preceding = ("{{mainapp|Finnish conjugation/%s}}"):format(verbtype),
			additional = addl,
			breadcrumb = {name = ("''%s''-type"):format(verbtype), nocap = true},
			parents = parents,
		}
	end
end)

labels["bentuk kata kerja basahan"] = {
	description = "Bentuk kata kerja basahan bahasa {{{langname}}}.",
	breadcrumb = "basahan",
	parents = {"bentuk kata kerja"},
}

------- Misc categories -------

labels["entri dengan infleksi tidak sepadan dengan nama laman"] = {
	description = "Entri bahasa {{{langname}}} dengan jadual infleksi dengan bentuk lema tidak sepadan dengan nama laman.",
	additional = "Ini biasa berlaku disebabkan oleh parameter salah atau hilang.",
	breadcrumb = "infleksi tidak sepadan dengan nama laman",
	parents = {{name = "penyelenggaraan entri", sort = "infleksi tidak sepadan dengan nama laman"}},
	hidden = true,
	can_be_empty = true,
}

labels["nama keluarga Latin"] = {
	description = "Nama keluarga bahasa {{{langname}}} yang dibentuk seolah-olah berasal Latin (biasanya dengan akhiran seperti {{m|fi||-(i)us}}).",
	breadcrumb = "Latin",
	parents = {"nama keluarga"},
}

labels["akhiran kes"] = {
	description = "Akhiran kes bahasa {{{langname}}}.",
	breadcrumb = "kes",
	parents = {"akhiran"},
}

return {LABELS = labels, HANDLERS = handlers}