Modul:category tree/wiktionary maintenance
Penampilan
- Berikut merupakan pendokumenan yang dijana oleh Templat:category tree data submodule documentation. [sunting]
- Pautan berguna: akar laman • sublaman akar laman • pautan • transklusi • kes ujian • kotak pasir
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 raw_categories = {}
local raw_handlers = {}
local m_template_parser = require("Module:template parser")
local get_lang = require("Module:languages").getByCode
local insert = table.insert
local is_internal_title = require("Module:pages").is_internal_title
local new_title = mw.title.new
local split_lang_label = require("Module:category tree").split_lang_label
local php_trim = require("Module:Scribunto").php_trim
local uses_hidden_category = require("Module:maintenance category").uses_hidden_category
-----------------------------------------------------------------------------
-- --
-- RAW CATEGORIES --
-- --
-----------------------------------------------------------------------------
raw_categories["Penyelenggaraan Wikikamus"] = {
description = "Kategori mengandungi laman yang dijejak untuk perhatian dan kemas kini penyunting.",
breadcrumb = "Penyelenggaraan",
parents = "Wiktionary",
}
raw_categories["Kategori kosong"] = {
topright = "{{shortcut|CAT:EC}}",
description = "Kategori tanpa sebarang ahli di bawahnya.",
additional = [=[Kategori diletakkan di sini oleh [[Modul:category tree]] apabila ia tidak mengandungi sebarang laman atau subkategori.
Kategori kosong tidak semestinya merupakan suatu masalah, tetapi mungkin menyelerakkan kategori induknya, atau menjadi kategori yatim jika struktur pokok kategori berubah. Oleh itu, kategori ini membantu menjejaki kes sedemikian dan membolehkannya dibersihkan.
Disebabkan oleh cara perisian wiki berfungsi, kategori akan muncul di sini untuk seketika selepas itu jika ia kosong pada mulanya tetapi mempunyai entri yang ditambahkan padanya kemudian. Hal ini boleh diperbaiki dengan hanya melakukan "suntingan batal" pada laman kategori, yakni sunting laman dan simpan tanpa membuat sebarang perubahan. (Alternatif lain boleh juga guna pilihan "null edit" yang disediakan oleh "tab pembersihan" (purge tab) pada [[Special:Preferences#mw-prefsection-gadgets|gadget]].) Hal ini boleh dielakkan dengan menambahkan entri pada kategori sebelum menciptanya. Penciptaan kategori dari "bawah ke atas" juga membantu: bermula pada tahap paling rendah yang mempunyai entri, kemudian mencipta kategori induknya, kemudian kategori induk bagi kategori itu, dan seterusnya.]=],
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Kategori dengan nama tidak betul"] = {
description = "Kategori dengan nama yang tidak berpadanan dengan bentuk jangkaan dalam pohon kategori.",
additional = [=[Hal ini biasanya berlaku apabila parameter tambahan telah diberikan kepada {{tl|auto cat}} yang tidak berpadanan dengan nama kategori, atau apabila terdapat masalah dengan huruf besar atau jarak dalam nama kategori.
==Lihat juga==
* [[:Kategori:Kategori tidak tertakrif dalam pokok kategori]]]=],
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Kategori tidak tertakrif dalam pokok kategori"] = {
description = "Kategori yang menggunakan {{tl|auto cat}}, tetapi tidak didaftarkan dalam modul data pokok kategori.",
additional = [=[Lihat kotak ralat yang dipaparkan pada mana-mana kategori ini untuk mendapatkan maklumat lanjut.
==Lihat juga==
* [[:Category:Kategori dengan nama tidak betul]]]=],
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Entri yang ditandakan sebagai tak sopan"] = {
description = "Entri diletakkan dalam kategori ini secara automatik apabila ditandakan dengan {{temp|menghina}}. Jangan tambahkan entri pada kategori ini secara manual.",
parents = "Penyelenggaraan Wikikamus",
breadcrumb = "Ditandakan sebagai tak sopan",
can_be_empty = true,
hidden = true,
}
raw_categories["Kategori tersembunyi"] = {
description = "Kategori yang menggunakan suis tingkah laku <code>[[mw:Help:Magic words#HIDDENCAT|<nowiki>__HIDDENCAT__</nowiki>]]</code>, yang menyembunyikan kategori ini daripada senarai kategori umum serta tidak akan dapat dilihat pengguna melainkan keutamaan penampilan diubah.",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Kategori besar"] = {
description = "Kategori dengan lebih daripada 1 juta ahli.",
additional = "Kategori sedemikian menyebabkan sambungan [[mw:Extension:DynamicPageList (Wikimedia)|DynamicPageList]] yang dilumpuhkan, yang biasanya digunakan untuk menyenaraikan laman terbaharu dan tertua dalam sesebuah kategori. Hal ini kerana kategori melebihi saiz itu dimuatkan dengan sangat perlahan apabila ia didayakan, dan dalam beberapa kes menjadi tidak boleh diakses kerana tamat masa.",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Laman yang diindeks"] = {
description = "Laman yang menggunakan suis tingkah laku <code>[[mw:Help:Magic words#INDEX|<nowiki>__INDEX__</nowiki>]]</code>, yang memberitahu enjin pencarian agar mengindekskan laman tersebut.",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Laman tak diindeks"] = {
description = "Laman yang menggunakan suis tingkah laku <code>[[mw:Help:Magic words#NOINDEX|<nowiki>__NOINDEX__</nowiki>]]</code>, yang memberitahu enjin pencarian agar tidak mengindekskan laman tersebut.",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Pages using deprecated templates"] = {
description = "This category contains entries, reconstruction pages, appendixes, sign glosses and citations pages using deprecated templates—templates that have failed our deletion process, and/or that have been replaced by superior templates.",
additional = [=[This category is populated by {{tl|deprecated code}} and {{tl|deprecated lang param usage}}. The former is wrapped around templates that have been completely deprecated and remove from mainspace (particularly those in [[:Category:Successfully deprecated templates]]). The latter is wrapped around non-deprecated templates that accept the deprecated {{para|lang}} parameter; any use of that parameter will place the page in [[:Category:Pages using deprecated templates]]. Ideally, this category will be empty.
Any pages in this category, particularly those in the mainspace, need to have their deprecated template usages corrected. ]=],
breadcrumb = "Using deprecated templates",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Laman menggunakan templat lite"] = {
description = "Pages which use at least one of the lite templates.",
additional = "See [[:Category:Lua-free templates]].",
breadcrumb = "Menggunakan templat lite",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Laman dengan aksara tab"] = {
description = "Pages which contain a tab character in their wikitext.",
additional = "These should either be removed or replaced with spaces, because they go against [[WT:NORM]].",
breadcrumb = "Aksara tab",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Laman dengan pengepala bahasa dalam susunan salah"] = {
description = "Pages in which the headings for each language's entry are in the wrong order.",
additional = "Level 2 language headings should be in alphabetical order, except for Translingual and English, which go at the top (in that order).",
breadcrumb = "Pengepala bahasa dalam susunan salah",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Laman dengan pengepala bahasa tidak piawai"] = {
description = "Pages which contain a level 2 heading which does not match any language's canonical name.",
additional = "The level 2 language heading for each language should always be that language's canonical name.",
breadcrumb = "Pengepala bahasa tidak piawai",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Laman dengan pengepala L1 tidak dikehendaki"] = {
description = "Pages which contain an unwanted level 1 heading.",
additional = "Level 1 headings are not used in Wiktionary content pages, and only occur due to user error or vandalism.",
breadcrumb = "Pengepala L1 tidak dikehendaki",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Laman dengan parameter templat bertanda kurung dakap gandaan tiga"] = {
description = "Pages which contain raw template parameters in the form of triple braces.",
additional = "Triple-brace template parameters (e.g. {{param|param}}) are intended for use in templates, as they are substituted with the relevant template argument when the page is transcluded. Although they can theoretically be used on any page, there are currently no legitimate uses for them in content namespaces.\n\nTemplate parameters usually occur due to typos, or when {{tl|subst:}} has been used with a template that isn't supposed to be substed.",
breadcrumb = "Parameter templat mentah",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Laman dengan percanggahan DEFAULTSORT"] = {
topright = "{{shortcut|CAT:DEFAULTSORT}}",
description = "Pages on which the {{tl|DEFAULTSORT:}} magic word has been used multiple times with different values.",
additional = "In some (but not all) cases, this causes a warning to display on the page. In the vast majority of instances, an explicit use of {{tl|DEFAULTSORT:}} in wikitext should be <u>removed</u>.This is because the {{tl|head}} template handles it automatically. The only instances where it should be used in wikitext is outside of entries (i.e. outside of mainspace or the Reconstruction namespace)." ..
"\n\nSee also [[:Category:Pages with DISPLAYTITLE conflicts]].",
breadcrumb = "DEFAULTSORT conflicts",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Laman dengan percanggahan DISPLAYTITLE"] = {
topright = "{{shortcut|CAT:DISPLAYTITLE}}",
description = "Pages on which the {{tl|DISPLAYTITLE:}} magic word has been used multiple times with different values.",
additional = "In some (but not all) cases, this causes a warning to display on the page. In the vast majority of instances, an explicit use of {{tl|DISPLAYTITLE:}} in wikitext should be <u>removed</u>.This is because the {{tl|head}} template handles it automatically. The only instances where it should be used in wikitext is outside of entries (i.e. outside of mainspace or the Reconstruction namespace)." ..
"\n\nSee also [[:Category:Pages with DEFAULTSORT conflicts]].",
breadcrumb = "Percanggahan DISPLAYTITLE",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Laman dengan kunci isih mentah"] = {
description = "Pages on which a sortkey has been used with a raw category.",
additional = "For example, {{code|<nowiki>[[Category:IPA symbols|B]]</nowiki>}}." ..
"\n\nThese are a priority to replace with category templates, since they are hard-coded and override the {{tl|DEFAULTSORT:}} value for the page. This causes problems if there are any changes to the sorting scheme for the category, because there is no way of changing them centrally.\n\n" ..
"By comparison, raw categories which have no sortkey are less of a problem, because they will use the {{tl|DEFAULTSORT:}} value; this can be centrally controlled and is designed to be language-neutral, so avoids the issue of different editors using multiple different sorting schemes for the same category. However, they should still be replaced with category templates, since there may be additional language-specific sorting rules which cannot otherwise be applied.",
breadcrumb = "Kunci isih mentah",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Laman yang ada ralat skrip"] = {
topright = "{{shortcut|CAT:E|CAT:ERR|CAT:ERROR}}",
description = "Laman yang mempunyai ralat dalam skrip [[Wikikamus:Scribunto|Lua]].",
additional = "Jika entri disenaraikan di sini untuk lebih daripada satu atau dua hari, ralat tersebut mungkin perlu dilaporkan di [[Wikikamus:Kedai Kopi|Kedai Kopi]]. Ralat memori adalah sumber biasa ralat ini; lihat perbincangan di [[Wikikamus:Ralat memori Lua]]." ..
"\n\nOleh kerana perisian MediaWiki di wiki ini tidak mengemas kini laman dengan serta-merta apabila perubahan berlaku dalam templat atau modul, ralat yang disenaraikan di sini mungkin telah pun dibetulkan. Oleh itu, sila pastikan bahawa ralat masih wujud sebelum melaporkan masalah. Anda boleh melakukan ini dengan melakukan \"[[meta:Help:Dummy_edit#Null_edit|suntingan kosong]]\" (sunting kemudian simpan sesuatu laman tanpa perubahan)., dan jika ralat telah dibetulkan tanpa menyimpannya." ..
"\n\n<u>Anda boleh menggunakan [https://ms.wiktionary.org/wiki/Khas:ApiSandbox#action=purge&format=json&forcelinkupdate=1&generator=categorymembers&utf8=1&formatversion=2&gcmtitle=Kategori%3ALaman%20yang%20ada%20ralat%20skrip&gcmlimit=20 pautan ini] dan tekan \"Buat permintaan\" untuk membersihkan cache sehingga 20 laman daripada kategori ini dalam satu klik.</u> Nombor ini boleh dilaraskan sehingga 5,000, tetapi apa-apa yang melebihi 30-100 mungkin akan menyebabkan tamat masa (bergantung pada saiz laman)." ..
"\n\nKandungan kategori ini dikawal oleh [[Templat:kategori penyelenggaraan]]. Pada masa ini ia ditetapkan untuk meletakkan laman perbincangan, laman pengguna{{,}} dan modul dan templat kotak pasir pengguna dalam kategori yang berasingan." ..
"\n\nLihat juga [[:Kategori:Laman dengan ralat ParserFunction]]",
breadcrumb = "Ralat skrip",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Laman dengan ralat ParserFunction"] = {
topright = "{{shortcut|CAT:PFE}}",
description = "Laman yang ada ralat pada kata ajaib [[mw:Help:Extension:ParserFunctions|ParserFunction]].",
additional = "Examples of these magic words are {{tl|#expr:}} and {{tl|#time:}}. If entries are listed here for more than a day or two, the error should probably be reported at [[Wiktionary:GP|the Grease Pit]]." ..
"\n\nBecause the software does not immediately update pages when a change occurs in a template or module, errors listed here may have already been fixed. Therefore, please ensure that the error is still present before reporting problems. You can do this by performing a \"[[meta:Help:Dummy_edit#Null_edit|null edit]]\" (editing the page and saving without making changes). If the error goes away then, it has already been fixed." ..
"\n\n<u>You can use [https://en.wiktionary.org/wiki/Special:ApiSandbox#action=purge&format=json&forcelinkupdate=1&generator=categorymembers&utf8=1&formatversion=2&gcmtitle=Category%3APages%20with%20ParserFunction%20errors&gcmlimit=20 this link] and press \"Make request\" to purge the cache of up to 20 pages from this category in one click.</u> This number can be adjusted up to 5,000, but anything above 30-100 will likely cause time-outs (depending on the size of the pages)." ..
"\n\nThe contents of this category is controlled by [[Template:maintenance category]]. It is currently set to place talk pages, user pages{{,}} and user sandbox modules and templates in a separate category." ..
"\n\nSee also [[:Category:Pages with module errors]].",
breadcrumb = "ralat ParserFunction",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Requests for moves, mergers and splits"] = {
description = "Pages and categories which have been tagged with a request for them to be moved, merged or split.",
breadcrumb = "Moves, mergers and splits",
parents = {"Penyelenggaraan Wikikamus", "Requests"},
can_be_empty = true,
hidden = true,
}
raw_categories["Pages to be merged"] = {
description = "Pages tagged to be merged by the {{tl|merge}} template.",
parents = "Requests for moves, mergers and splits",
can_be_empty = true,
}
raw_categories["Pages to be moved"] = {
description = "Pages tagged to be moved by the {{tl|move}} template.",
parents = "Requests for moves, mergers and splits",
can_be_empty = true,
}
raw_categories["Pages to be split"] = {
description = "Pages tagged to be split by the {{tl|split}} template.",
parents = "Requests for moves, mergers and splits",
can_be_empty = true,
}
raw_categories["Pages using invalid parameters when calling templates"] = {
description = "Pages that use unrecognized parameters when calling a template.",
breadcrumb = "Invalid template parameters",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
}
raw_categories["Laman yang menggunakan catfix"] = {
description = "Laman yang menggunakan gajet <code>[[MediaWiki:Gadget-catfix.js|catfix]]</code>.",
additional = "This processes links to entries in language-specific categories by adding language-specific formatting, and points them to the language's section of the entry.",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Laman yang memanggil Templat:minitoc"] = {
description = "Laman yang memaparkan jadual kandungan mini dengan memanggil {{tl|minitoc}}.",
additional = "This is used on very large pages with many entries, to assist with navigation.",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Kategori yang memanggil Templat:auto cat"] = {
description = "Kategori yang telah diletakkan dalam kategori lain dengan memanggil {{tl|auto cat}}.",
additional = "Inilah cara yang diutamakan untuk mensubkategorikan kesemua kategori. Sebab utama kategori ini adalah untuk memudahkan pencarian kategori yang tidak menggunakan {{tl|auto cat}} melalui penggunaan carian negatif (yakni dengan membuat saringan carian menggunakan {{code|-incategory:\"{{PAGENAME}}\"}}).",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Kategori dengan kategori menggunakan penanda mentah"] = {
description = "Categories that have been placed in another category using raw wiki markup (e.g. {{code|<nowiki>[[Category:Wiktionary]]</nowiki>}}). They should be added to the [[Module:category tree|category tree]] data instead.",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
raw_categories["Pages using deprecated source tags"] = {
description = "Pages that use the [[mw:Extension:SyntaxHighlight|SyntaxHighlight]] extension with legacy {{wt|source}} tags instead of {{wt|syntaxhighlight}}.",
breadcrumb = "Deprecated source tags",
parents = "Penyelenggaraan Wikikamus",
can_be_empty = true,
hidden = true,
}
insert(raw_handlers, function(data)
local template_type = data.category:match("^Pages using invalid parameters when calling (.+) templates$")
if not template_type then
return
end
local parents = {{
name = "Pages using invalid parameters when calling templates",
sort = template_type == "general use" and "*" or template_type,
}}
local lang = require("Module:languages").getByCanonicalName(template_type, nil, true)
if lang then
insert(parents, {name = "entry maintenance", is_label = true, lang = lang:getCode()})
end
return {
lang = lang and lang:getCode() or nil,
description = "Pages that use unrecognized parameters when calling " .. template_type .. " templates.",
parents = parents,
breadcrumb = template_type,
}
end)
do
local prefixes = require("Module:table").listToSet{"list", "P", "R", "RQ", "table", "U"}
local function add_parent(parents, seen, cat_type, sortkey)
if seen[cat_type] then
return
end
insert(parents, {
name = ("Pages using invalid parameters when calling %s templates"):format(cat_type),
sort = sortkey,
})
seen[cat_type] = true
end
insert(raw_handlers, function(data)
local template = data.category:match("^Pages using invalid parameters when calling (.+)$")
if not template then
return
end
-- Resolve any redirects.
template = new_title(template)
while template do
local redirect = template.redirectTarget
if not (redirect and is_internal_title(redirect)) then
break
end
template = redirect
end
-- Disallow templates which would always hidden maintennace categories (e.g. sandboxes).
if not (template and not uses_hidden_category(template)) then
return
end
local prefixed_text, lang = template.prefixedText
if template.namespace == 10 then
local name = template.text
-- Remove the prefix if present (e.g. "R:" or "RQ:").
local prefix, text = name:match("^(.-):(.+)")
if not (prefix and prefixes[prefix]) then
text = name
end
-- Check the initial language code, chopping off hyphenated sections until there's a match or they run out.
local code = mw.ustring.match(text, "^[a-z][a-zA-Z-]*[a-zA-Z]%f[^%w]")
while code do
lang = get_lang(code)
if lang then
break
end
code = code:match("(.+)%-%a*$")
end
-- If no match and it's a list: or table: template, check if the template name ends "/CODE".
if not lang and (prefix == "list" or prefix == "table") then
code = text:match("%f[^/]%l[%a-]*%a$")
if code then
lang = get_lang(code)
end
end
end
local sortkey = template.text
local parents, seen = {}, {}
-- Categorize as language-specific if a language was found.
if lang then
add_parent(parents, seen, lang:getCanonicalName(), sortkey)
end
-- Also grab any language categories from the template page.
for _, cat in ipairs(template.categories) do
if cat:sub(-10) == " templates" or cat:sub(-13) == " subtemplates" then
local cat_lang = split_lang_label(new_title(cat).text)
if cat_lang then
add_parent(parents, seen, cat_lang:getCanonicalName(), sortkey)
end
end
end
-- If none were found, categorize as general use.
if #parents == 0 then
add_parent(parents, seen, "general use", sortkey)
end
-- Only add can_be_empty if the template exists and contains checkparams.
local content, can_be_empty = template:getContent()
if content then
-- Check for {{#invoke:checkparams|warn|...}}.
-- args[1] is the module and args[2] is the function name, so #INVOKE: will throw an error if either is not present.
for template in require("Module:template parser").find_templates(content) do
if template:get_name() == "#INVOKE:" then
local args = template:get_arguments()
local arg_2 = args[2]
if arg_2 and php_trim(args[1]) == "checkparams" and php_trim(arg_2) == "warn" then
can_be_empty = true
break
end
end
end
end
return {
canonical_name = "Pages using invalid parameters when calling " .. prefixed_text,
lang = lang and lang:getCode() or nil,
description = ("Pages that use unrecognized parameters when calling {{tl|%s}}.")
:format(m_template_parser.getTemplateInvocationName(template)),
additional = "These template calls should be reviewed and the invalid parameter(s) should be corrected or removed.",
breadcrumb = prefixed_text,
parents = parents,
can_be_empty = can_be_empty,
hidden = true,
}
end)
end
return {RAW_CATEGORIES = raw_categories, RAW_HANDLERS = raw_handlers}