Pergi ke kandungan

Modul:category tree/modules

Daripada Wikikamus

Submodul data ini mentakrifkan sebahagian daripada struktur kategori Wikikamus.

Untuk pengenalan kepada sistem poscatboiler dan penerangan tentang cara menambah atau mengubah suai kategori, lihat Modul:category tree/data/doc.

local labels = {}
local raw_categories = {}
local raw_handlers = {}

local insert = table.insert
local pattern_escape = require("Module:string utilities").pattern_escape

-----------------------------------------------------------------------------
--                                                                         --
--                                  LABELS                                 --
--                                                                         --
-----------------------------------------------------------------------------


labels["Modul"] = {
	description = "[[Wikikamus:Modul|Modul]] bagi bahasa {{{langname}}} yang memiliki kod Lua untuk menjana dan menguruskan entri.",
	umbrella = {
		parents = {{name = "Modul", sort = " "}},
		breadcrumb = "mengikut bahasa",
	},
	parents = {{name = "{{{langcat}}}", raw = true}},
}

labels["Modul data"] = {
	description = "[[Wikikamus:Modul|Modul]] bagi bahasa {{{langname}}} yang mengandungi data yang digunakan oleh modul lain.",
	umbrella = {
		parents = {{name = "Modul data", sort = " "}},
		breadcrumb = "mengikut bahasa",
	},
	parents = {"Modul"},
}

labels["Modul data sinonim dialek"] = {
	description = "[[:en:Wiktionary:Modules|Modul]] bahasa {{{langname}}} yang mengandungi data dengan penggunaannya melalui {{tl|dialect synonyms}}.",
	umbrella = {
		parents = {{name = "Modul data sinonim dialek", sort = " "}},
		breadcrumb = "mengikut bahasa",
	},
	breadcrumb = "sinonim dialek",
	parents = {"Modul data"},
}

labels["Modul infleksi"] = {
	description = "{{{langname}}} [[inflection]] [[Wiktionary:Modules|modules]], which contain Lua code for generating conjugation and declension tables.",
	umbrella = {
		parents = {{name = "Modul infleksi", sort = " "}},
		breadcrumb = "mengikut bahasa",
	},
	breadcrumb = "infleksi",
	parents = {"Modul", {name = "Templat jadual infleksi", sort = " "}},
}

labels["Modul kes ujian"] = {
	description = "{{{langname}}} [[testcase]] [[Wiktionary:Modules|modules]], which contain Lua code for testing other modules.",
	umbrella = {
		parents = {{name = "Modul kes ujian", sort = " "}},
		breadcrumb = "mengikut bahasa",
	},
	breadcrumb = "kes ujian",
	parents = {"Modul"},
}




-----------------------------------------------------------------------------
--                                                                         --
--                              RAW CATEGORIES                             --
--                                                                         --
-----------------------------------------------------------------------------

--[=[
Correctly defining a new module type here:
1. The breadcrumb generally does not need to be given because there is code at the bottom of this file
   to generate the breadcrumb in a smart fashion by chopping off a suffix derived from the parent or any of
   its ancestors.
2. Module types can be nested under other module types, but also list them directly under 'Modules' as a
   secondary parent. (This violates a principle of non-duplication of categories but makes it much easier to
   locate a given module type.)
]=]

raw_categories["Modul"] = {
	description = "Ini ialah kategori pemegang lazim bagi modul.",
	additional = "For more information on what modules are and how they work, see [[Wiktionary:Scribunto]]. For a complete list of all modules, see [[Special:PrefixIndex/Module:|here]].",
	parents = {"Kategori:Wikikamus"},
}

raw_categories["Modul belum dikategorikan"] = {
	description = "Modul yang belum diberikan kategori.",
	additional = "Modul diletakkan di sini melalui [[Modul:pendokumenan]] disebabkan oleh keadaan tertentu. Lihat pendokumenan modul tersebut untuk maklumat lanjut.",
	parents = { {name = "Modul", sort = " "} },
}

raw_categories["Modul lampiran"] = {
	preceding = "{{also|:Kategori:Templat lampiran}}",
	description = "Modules with functions that generate content for or extract information from pages in the Appendix namespace.",
	parents = { "Modul" },
}

raw_categories["Modul sokongan bot"] = {
	description = "Modules for supporting individual bot accounts.",
	parents = { "Modul" },
}

raw_categories["Modul kategori"] = {
	preceding = "{{also|:Kategori:Templat pengkategorian|:Kategori:Templat kategori}}",
	description = "Modules for adding categories to pages or generating the description and subcategories of category pages.",
	parents = { "Modul" },
}

raw_categories["Modul maklumat aksara"] = {
	preceding = "{{also|:Kategori:Templat maklumat aksara}}",
	description = "Modules containing information on individual characters, or containing functions generating such information.",
	parents = { "Modul" },
}

raw_categories["Character insertion modules"] = {
	preceding = "{{also|:Category:Character insertion templates}}",
	description = "Modules that implement templates that provide easier ways to type characters that are not found in most keyboard layouts.",
	parents = { "Modul penjanaan laman", "Modul" },
}

raw_categories["Collections modules"] = {
	description = "Modules containing functions used to implement collections (arrays, maps, etc.).",
	parents = { "Utility modules", "Modul" },
}

raw_categories["Modul data"] = {
	description = "Modul yang tidak mengandungi fungsi, tetapi hanya mengeksport jadual data yang digunakan oleh modul lain.",
	additional = "Modul yang berada dalam kategori ini harus diimport menggunakan <code>mw.loadData</code> dan bukannya <code>require</code>.",
	parents = { "Modul" },
}

raw_categories["Category tree data modules"] = {
	preceding = "{{also|:Category:Category tree data modules/lang|:Category:Category tree data modules/topic}}",
	description = "[[Wiktionary:Modules|Modules]] containing data and code used by the category tree system for constructing the descriptions of categories.",
	parents = { "Modul data", "Category modules" },
}

raw_categories["Category tree data modules/lang"] = {
	preceding = "{{also|:Category:Category tree data modules|:Category:Category tree data modules/topic}}",
	description = "[[Wiktionary:Modules|Modules]] containing data and code used by the category tree system for constructing the descriptions of language-specific categories.",
	breadcrumb = "lang",
	parents = { {name = "Category tree data modules", sort = "lang"} },
}

raw_categories["Category tree data modules/topic"] = {
	preceding = "{{also|:Category:Category tree data modules|:Category:Category tree data modules/lang}}",
	description = "[[Wiktionary:Modules|Modules]] containing data and code used by the category tree system for constructing the descriptions of topic categories.",
	breadcrumb = "topic",
	parents = { {name = "Category tree data modules", sort = "topic"} },
}

raw_categories["Character insertion data modules"] = {
	preceding = "{{also|:Category:Character insertion templates}}",
	description = "Modules containing data for use by {{temp|chars}}.",
	parents = { "Modul data", "Character insertion modules" },
}

raw_categories["Modul data sinonim dialek"] = {
	preceding = "{{also|:Kategori:Character insertion templates}}",
	description = "Modul yang mengandungi data dengan penggunaannya melalui {{tl|dialect synonyms}}.",
	parents = { "Modul data" },
}

raw_categories["Date modules"] = {
	description = "Modules that implement functionality to convert or otherwise manipulate dates in various calendar systems.",
	parents = { "Utility modules", "Modul" },
}

raw_categories["Debugging modules"] = {
	description = "Modules used for debugging.",
	additional = "Some should only be used in sandbox modules or when using the " ..
	"[[mw:Extension:TemplateSandbox|{{MediaWiki:Templatesandbox-editform-legend}}]] button in the edit page of modules and templates.",
	parents = { "Modul" },
}

raw_categories["Definition modules"] = {
	preceding = "{{also|:Category:Definition templates}}",
	description = "Modules that implement templates used in [[Wiktionary:Glossary#definition line|definition lines]] of entries.",
	parents = { "Modul penjanaan laman", "Modul" },
}


raw_categories["Deprecated modules"] = {
	description = "Modules that should not be used, as their functions are performed by newer modules.",
	parents = { "Modul", "Category:Wiktionary maintenance" },
}

raw_categories["Discussion modules"] = {
	preceding = "{{also|:Category:Discussion templates}}",
	description = "Modules concerning discussion pages.",
	parents = { "Modul" },
}

raw_categories["Display text-generating modules"] = {
	description = "Modules that are used to generate display text.",
	
	additional = "Display text determines what is shown to the reader. In some languages it must be normalized, " ..
	"due to common errors caused by confusable characters, or so as to ensure a consistent display format.",
	parents = { "Modul" },
}

raw_categories["Documentation modules"] = {
	preceding = "{{also|:Category:Documentation templates}}",
	description = "Modules for generating documentation pages.",
	parents = { "Modul" },
}

	
raw_categories["Encoding modules"] = {
	description = "Modules for converting between different textual encodings.",
	parents = { "Utility modules", "Modul" },
}

raw_categories["Entry-generating modules"] = {
	preceding = "{{also|:Category:Entry templates}}",
	description = "Modules with functions that are used to generate new entries.",
	parents = { "Modul" },
}

raw_categories["Entry name-generating modules"] = {
	description = "Modules that generate entry names, which typically have certain diacritics stripped compared with the form in links and headwords.",
	parents = { "Modul" },
}
	
raw_categories["External link modules"] = {
	preceding = "{{also|:Category:External link templates}}",
	description = "Modules that are used in [[:Category:External link templates|external link templates]], i.e. which link to websites outside of the MediaWiki Foundation purview.",
	parents = { "Modul penjanaan laman", "Modul" },
}

raw_categories["Modul etimologi"] = {
	preceding = "{{also|:Category:Etymology templates}}",
	description = "Modules that implement templates that define the etymology of entries.",
	parents = { "Modul penjanaan laman", "Modul" },
}

raw_categories["Form-of modules"] = {
	preceding = "{{also|:Category:Form-of templates}}",
	description = "Modules that generate the definition line of non-lemma forms, e.g. verb forms and noun forms.",
	parents = { "Definition modules", "Modul penjanaan laman", "Modul" },
}

raw_categories["Modul baris pengepala kata"] = {
	preceding = "{{also|:Category:Headword-line templates}}",
	description = "Modul yang menyokong [[:Kategori:Templat baris pengepala kata mengikut bahasa|templat baris pengepala kata]] untuk bahasa tertentu.",
	additional = "Lihat juga [[:Kategori:Templat baris pengepala kata]].",
	parents = { "Modul penjanaan laman", "Modul" },
}

raw_categories["Modul infleksi"] = {
	description = "Modules used to support [[:Category:Inflection-table templates by language|inflection templates]] for a specific language.",
	parents = { "Modul penjanaan laman", "Modul" },
}

raw_categories["Internal link modules"] = {
	preceding = "{{also|:Category:Internal link templates}}",
	description = "Modules that are used in [[:Category:Internal link templates|internal link templates]], i.e. which link between Wiktionary entries.",
	parents = { "Modul penjanaan laman", "Modul" },
}

raw_categories["Interwiki modules"] = {
	preceding = "{{also|:Category:Interwiki templates}}",
	description = "Modules that are used in [[:Category:Interwiki templates|interwiki templates]], i.e. which link to other MediaWiki projects.",
	parents = { "Modul penjanaan laman", "Modul" },
}

raw_categories["JSON-generating modules"] = {
	description = "Modules with functions that generate data in JSON format.",
	parents = { "Modul" },
}

raw_categories["Modul bahasa dan tulisan"] = {
	description = "Modules that process language and script codes and return data on them.",
	parents = { "Modul" },
}

raw_categories["Modul senarai"] = {
	preceding = "{{also|:Category:List templates}}",
	description = "Modules that generate lists, tables or tree diagrams of entries or other structured data.",
	parents = { "Modul penjanaan laman", "Modul" },
}

raw_categories["Modul penyelenggaraan"] = {
	preceding = "{{also|:Category:Maintenance templates}}",
	description = "Modules that implement templates used for maintaining entries.",
	additional = "Examples are cleanup templates (e.g. {{tl|attention}}), deletion templates (e.g. {{tl|rfd}}) and " ..
	"verification templates (e.g. {{tl|rfv}}).",
	parents = { "Modul" },
}

raw_categories["Modul nombor"] = {
	preceding = "{{also|:Category:Number templates}}",
	description = "Modules that handle conversion and/or formatting of numbers and numerals in various representations.",
	parents = { "Modul utiliti", "Modul" },
}

raw_categories["Modul penjanaan laman"] = {
	description = "Modules that generate parts of a mainspace page (e.g. headword line, definition, inflection, links, etc.).",
	parents = { "Modul" },
}

raw_categories["Parameter parsing modules"] = {
	description = "Modules containing functions used to parse template parameters.",
	parents = { "Utility modules", "Modul" },
}

raw_categories["Modul sebutan"] = {
	preceding = "{{also|:Category:Pronunciation templates}}",
	description = "Modules that fuel templates that are used to create the language-specific pronunciation of entries.",
	parents = { "Modul penjanaan laman", "Modul" },
}

raw_categories["Pronunciation testcase modules"] = {
	description = "Modules used to test other pronunciation modules.",
	parents = { "Testcase modules", {name = "Pronunciation modules", sort = "Testcase"} },
}

raw_categories["Quotation and usage example modules"] = {
	description = "Modules that implement templates used to format quotations and usage examples.",
	parents = { "Definition modules", "Modul penjanaan laman", "Modul" },
}

raw_categories["Modul rujukan"] = {
	preceding = "{{also|:Category:Reference templates}}",
	description = "Modules that are used for [[:Category:Reference templates|reference templates]].",
	parents = { "Modul penjanaan laman", "Modul" },
}

raw_categories["Modul kotak pasir"] = {
	description = "Versi ujian modul yang disediakan buat tujuan penghasilan.",
	parents = { "Modul" },
}

raw_categories["Semantic relation modules"] = {
	preceding = "{{also|:Category:Semantic relation templates}}",
	description = "Modules that implement templates used to indicate other terms semantically related to a " ..
	"particular sense, e.g. [[synonym]]s or [[antonym]]s.",
	parents = { "Modul penjanaan laman", "Modul" },
}

raw_categories["Sign language modules"] = {
	description = "Modules used for sign languages.",
	parents = { "Modul" },
}

raw_categories["Sortkey-generating modules"] = {
	description = "Modules that generate sortkeys, which determine the order of entry names in categories.",
	parents = { "Modul" },
}

raw_categories["String modules"] = {
	description = "Modules containing functions used to manipulate strings.",
	parents = { "Utility modules", "Modul" },
}

raw_categories["Modul Swadesh"] = {
	description = "Modul yang mengandungi [[senarai Swadesh]].",
	parents = { "Modul" },
}

raw_categories["Template interface modules"] = {
	description = "Modules whose purpose is to provide an interface between templates and the functions of a module.",
	additional = "They are usually named <code>.../templates</code>, and the functions present within them usually all " ..
	"have only a \"frame\" parameter.",
	parents = { "Modul" },
}

raw_categories["Modul kes ujian"] = {
	description = "Modul yang digunakan untuk menguji modul-modul lain.",
	parents = { "Modul" },
}

raw_categories["Modul kes ujian dengan kegagalan"] = {
	description = "Modul dengan kegagalan dalam kes-kes ujiannya.",
	additional = "This category is added automatically by [[Module:UnitTests]] when a test case fails.",
	parents = { "Modul kes ujian" },
}

raw_categories["Modul penjejakan"] = {
	description = "Modules that add tracking templates.",
	parents = { "Debugging modules", "Modul" },
}

raw_categories["Modul transliterasi"] = {
	description = "Modules that automatically convert text in one script to another.",
	additional = "Most of them convert non-Latin scripts to Latin (romanisation/romanization), and are used by " ..
	"templates or modules to generate transliteration of text that is tagged with a particular language. Each " ..
	"language's transliteration module is specified in its data table (for which, see the category {{catlink|Language data modules}}).",
	parents = { "Modul" },
}

raw_categories["Transliteration testcase modules"] = {
	description = "Modules used to test other transliteration modules.",
	parents = { "Testcase modules", {name = "Transliteration modules", sort = "Testcase"} },
}

raw_categories["Unused modules"] = {
	description = "Unused modules.",
	parents = { "Modul" },
}

raw_categories["User sandbox modules"] = {
	description = "Modules that are for personal use and testing by individual editors.",
	additional = "These should all begin with <code>User:</code> followed by the user's name. If several " ..
	"sandbox modules are needed by a single user, subpages can be created. These modules should not be used in real " ..
	"Wiktionary content pages, as all content on those pages should be editable by anyone and, if necessary, edit protected.",
	parents = { "Sandbox modules", "Modul" },
}

raw_categories["Utility modules"] = {
	description = "Modules that serve some sort of utility purpose in various entries.",
	additional = "Avoid categorizing directly into this category, but use one of the more specific (and semantically " ..
	"well-defined) module categories. Note also that modules used by multiple languages should go directly in this " ..
	"category if necessary, while modules only used by one language should be in [[:Category:Language-specific utility modules]].",
	parents = { "Modul" },
}

raw_categories["Language-specific utility modules"] = {
	description = "Modules that deal with several utilities needed by a certain language.",
	additional = "Usually their names end with {{cd|-utilities}} or {{cd|-common}} (preceded by the language code), " ..
	"although more specific utility modules that one language uses may reside here as well. If a utility is used by " ..
	"many languages, it should be in [[:Category:Utility modules]].",
	parents = {{name = "Utility modules", sort = " "}},
}

raw_categories["Vote modules"] = {
	description = "Modules used to manage Wiktionary votes.",
	parents = { "Modul" },
}

raw_categories["Wikitext parsing modules"] = {
	description = "Modules that contain functions that grab the wikitext of a page and get information from it by " ..
	"performing string operations on it.",
	parents = { "Modul" },
}

-- Don't modify `raw_categories` while processing it, or items may be skipped.
local new_cats = {}
for raw_cat, obj in pairs(raw_categories) do
	local by_script = raw_cat .. " mengikut tulisan"
	if raw_cat ~= "Modul" and raw_cat ~= "Modul data" and not raw_categories[by_script] then
		new_cats[by_script] = {
			description = raw_cat .. ", dikategorikan mengikut jenis tulisan yang dikendali atau digunakan.",
			additional = raw_cat .. " merupakan " .. mw.getContentLanguage():lcfirst(obj.description),
			breadcrumb = "mengikut tulisan",
			parents = {{name = raw_cat, sort = " "}},
		}
	end
end
for new_cat, obj in pairs(new_cats) do
	raw_categories[new_cat] = obj
end


-----------------------------------------------------------------------------
--                                                                         --
--                                RAW HANDLERS                             --
--                                                                         --
-----------------------------------------------------------------------------


for _, mod_type in ipairs {"Entry name-generating", "Sortkey-generating", "transliterasi"} do
	insert(raw_handlers, function(data)
		local n, suffix = data.category:match(("^Modul %s digunakan oleh (%%d+) bahasa(?)$"):format(pattern_escape(mod_type)))
		-- Only match if there are no leading zeroes and the suffix is correct.
		if not (n and not n:match("^0%d") and suffix == (n == "1" and "" or "")) then
			return
		end
		return {
			breadcrumb = ("digunakan oleh %d bahasa%s"):format(n, suffix),
			description = data.category .. ".",
			can_be_empty = true,
			parents = {
				{name = ("Modul %s"):format(mod_type), sort = require("Module:category tree").numeral_sortkey(n)},
			},
		}
	end)
end


-- Add breadcrumb by chopping off the parent (or the parent's parent, etc.) from the end of the label, if possible.
for key, data in pairs(raw_categories) do
	if not data.breadcrumb then
		local parent = data.parents[1]
		while true do
			if type(parent) == "string" then
				local parent_re = " " .. pattern_escape(mw.getContentLanguage():lcfirst(parent)) .. "$"
				if key:find(parent_re) then
					data.breadcrumb = key:gsub(parent_re, "")
					break
				end
				if raw_categories[parent] then
					parent = raw_categories[parent].parents[1]
				else
					break
				end
			else
				break
			end
		end
	end
end

return {LABELS = labels, RAW_CATEGORIES = raw_categories, RAW_HANDLERS = raw_handlers}