မော်ဂျူး:category tree/wiktionary maintenance
ပုံပန်းသွင်ပြင်
Documentation for this module may be created at မော်ဂျူး:category tree/wiktionary maintenance/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["ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး"] = {
description = "တည်းဖြတ်သူများက အလေးထားဆောင်ရွက်ရန်နှင့် တိုးတက်ကောင်းမွန်အောင် မွမ်းမံပြင်ဆင်ရန်အတွက် ခြေရာခံစောင့်ကြည့်နေသော စာမျက်နှာများ ပါဝင်သည့် ကဏ္ဍများ။",
breadcrumb = "ထိန်းသိမ်းရေး",
parents = "ဝစ်ရှင်နရီ",
}
raw_categories["ဗလာဖြစ်နေသော ကဏ္ဍများ"] = {
topright = "{{shortcut|CAT:EC}}",
description = "ပါဝင်သူ မရှိသော ကဏ္ဍများ။",
additional = [=[စာမျက်နှာ သို့မဟုတ် ကဏ္ဍခွဲများ မပါဝင်သော ကဏ္ဍများကို ဤနေရာတွင် [[Module:category tree]] မှ ထားရှိသည်။
အကြောင်းအရာ မရှိသော ကဏ္ဍလွတ်များသည် မဖြစ်မနေ ပြဿနာတစ်ရပ် မဟုတ်သော်လည်း၊ ၎င်းတို့သည် မိခင်ကဏ္ဍများကို ရှုပ်ပွစေနိုင်သည် သို့မဟုတ် ကဏ္ဍဖွဲ့စည်းပုံ အပြောင်းအလဲရှိပါက မိခင်မဲ့ကာ လမ်းပျောက်ကျန်ရစ်ခဲ့သည့် ကဏ္ဍများ (orphaned) ဖြစ်သွားနိုင်သည်။ ထို့ကြောင့် ဤကဏ္ဍသည် ထိုကဲ့သို့သော အခြေအနေများကို ခြေရာခံရှာဖွေရာတွင် အထောက်အကူပြုပြီး ၎င်းတို့ကို ရှင်းလင်းဖယ်ရှားနိုင်ရန် ကူညီပေးသည်။
ဝီကီဆော့ဖ်ဝဲလ် အလုပ်လုပ်ပုံ သဘောသဘာဝကြောင့်၊ ကနဦးတွင် အလွတ်ဖြစ်နေပြီး နောက်ပိုင်းမှ အကြောင်းအရာများ ထည့်သွင်းလိုက်သည့် ကဏ္ဍများသည် ဤနေရာတွင် ခေတ္တမျှ ဆက်လက်ပေါ်နေတတ်ပါသည်။ ဤပြဿနာကို ဖြေရှင်းရန်အတွက် ကဏ္ဍစာမျက်နှာပေါ်တွင် "အချည်းနှီး တည်းဖြတ်မှု" (null edit) ပြုလုပ်နိုင်သည်။ ဆိုလိုသည်မှာ စာမျက်နှာကို တည်းဖြတ်ရန် ဖွင့်ပြီး မည်သည့်ပြောင်းလဲမှုမျှ မလုပ်ဆောင်ဘဲ သိမ်းဆည်းလိုက်ခြင်း ဖြစ်သည်။ (တနည်းအားဖြင့် "purge tab" gadget တွင် ပါရှိသော "null edit" ရွေးချယ်မှုကိုလည်း အသုံးပြုနိုင်သည်။) ဤအခြေအနေကို ရှောင်ရှားနိုင်ရန် ကဏ္ဍများကို မဖန်တီးမီ အကြောင်းအရာများကို ကြိုတင်ထည့်သွင်းထားသင့်သည်။ ထို့ပြင် ကဏ္ဍများကို "အောက်ခြေမှ အထက်သို့" ဖန်တီးခြင်းသည်လည်း အထောက်အကူ ဖြစ်စေပါသည်။ ဆိုလိုသည်မှာ အကြောင်းအရာများရှိသော အနိမ့်ဆုံးအဆင့်မှ စတင်ကာ ၎င်း၏ မိခင်ကဏ္ဍများကို အဆင့်ဆင့် ဖန်တီးသွားခြင်း ဖြစ်သည်။]=],
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Categories with incorrect names"] = {
description = "Categories with names that do not match the expected form within the category tree.",
additional =
[=[This usually happens when additional parameters have been given to {{tl|auto cat}} that don't match the name of the category, or when there is a problem with capitalization or spacing in the category name.
==See also==
* [[:Category:Categories that are not defined in the category tree]]]=],
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Categories that are not defined in the category tree"] = {
description = "Categories which use {{tl|auto cat}}, but which are not registered in the category tree data modules.",
additional = [=[See the error box displayed on any of these categories for more info.
==See also==
* [[:Category:Categories with incorrect names]]]=],
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Entries tagged as derogatory"] = {
description =
"Entries are placed in this category automatically when tagged with {{temp|derogatory}}. Do not add entries to this category manually.",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
breadcrumb = "Tagged as derogatory",
can_be_empty = true,
hidden = true,
}
raw_categories["Entries with deprecated labels"] = {
description =
"Entries which use labels which have been marked as deprecated and should no longer be used; these should be replaced according to the table below.",
additional =
[=[See all labels: [[Module:labels/data]], [[Module:labels/data/regional]], [[Module:labels/data/topical]].
{| class="wikitable sortable"
! Label
! Replace with
|-
| christianity || Christianity
|-
| currency || numismatics
|-
| emergency || emergency medicine
|-
| greekmyth || Greek mythology
|-
| industry || manufacturing
|-
| islam || Islam
|-
| morphology || linguistic morphology
|-
| musici || musical instruments
|-
| ordinal || ex. 1: [[14th]]: <nowiki>{{abbreviation of|fourteenth|lang=en}}</nowiki> <br> ex. 2: [[fourth]] (in definition): "The [[ordinal]] form of the number [[four]]."
|-
| plural || in the plural (usually)
|-
| quantum || quantum mechanics
|-
| singular || in the singular (usually)
|-
| usually plural<br/>usually in plural</br>usually in the plural || usually<nowiki>|</nowiki>in the plural
|-
| dual || in the dual
|-
| usually dual<br/>usually in dual</br>usually in the dual || usually<nowiki>|</nowiki>in the dual
|-
| vector || linear algebra
|}]=],
breadcrumb = "With deprecated labels",
can_be_empty = true,
hidden = true,
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
}
raw_categories["ဝှက်ထားသော ကဏ္ဍများ"] = {
description =
"<code>[[mw:Help:Magic words#HIDDENCAT|<nowiki>__HIDDENCAT__</nowiki>]]</code> ကို အသုံးပြုထားသော ကဏ္ဍများဖြစ်ပြီး၊ ၎င်းသည် ယင်းကဏ္ဍအား ၎င်း၏ အဖွဲ့ဝင်များနှင့် ကဏ္ဍခွဲများတွင် ဖော်ပြထားသည့် ကဏ္ဍစာရင်းများမှ ကွယ်ဝှက်ထားပေးသည်။",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Huge categories"] = {
description = "Categories with more than 1 million members.",
additional =
"Such categories have the [[mw:Extension:DynamicPageList (Wikimedia)|DynamicPageList]] extension disabled, which is normally used to list the newest and oldest pages in a category. This is because categories above that size load very slowly when it is enabled, and in some cases become inaccessible due to timing-out.",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Indexed pages"] = {
description =
"ရှာဖွေရေးအင်ဂျင်များအား ဤစာမျက်နှာကို အညွှန်းပြုလုပ်ရန် ညွှန်ကြားပေးသည့် <code>[[mw:Help:Magic words#INDEX|<nowiki>__INDEX__</nowiki>]]</code> အပြုအမူဆိုင်ရာ ခလုတ်ကို အသုံးပြုထားသော စာမျက်နှာများ။",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["အက္ခရာမစဉ်ထားသော စာမျက်နှာများ"] = {
description =
"ရှာဖွေရေးအင်ဂျင်များအား ဤစာမျက်နှာကို အညွှန်းပြုလုပ်ခြင်း မပြုရန် ညွှန်ကြားပေးသည့် <code>[[mw:Help:Magic words#NOINDEX|<nowiki>__NOINDEX__</nowiki>]]</code> အပြုအမူဆိုင်ရာ ခလုတ်ကို အသုံးပြုထားသော စာမျက်နှာများ။",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
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 = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Pages using lite templates"] = {
description = "Pages which use at least one of the lite templates.",
additional = "See [[:Category:Lua-free templates]].",
breadcrumb = "Using lite templates",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Pages with redundant inline etymon"] = {
description = "Pages where the inline etymon term exists and the ID matches the one on the etymon page.",
additional = "These should be reviewed and simplified to avoid redundant specification.",
breadcrumb = "Redundant inline etymon",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Pages using etymon with no ID"] = {
description =
"Pages where {{tl|etymon}} is used without an ID and the linked page has only one etymon template for the language.",
additional = "These should be updated to specify an explicit ID to avoid ambiguity if more etymons are added later.",
breadcrumb = "ID-less etymon",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Pages with inline etymon for redlinks"] = {
description = "Pages where {{tl|etymon}} is used inside another {{tl|etymon}} and the target term is a redlink.",
additional = "These should be reviewed once the target entries are created.",
breadcrumb = "Inline etymon for redlinks",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Pages with tab characters"] = {
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 = "Tab characters",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Pages with language headings in the wrong order"] = {
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 = "Language headings in the wrong order",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Pages with nonstandard language headings"] = {
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 = "Nonstandard language headings",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Pages with unwanted L1 headings"] = {
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 = "Unwanted L1 headings",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Pages with raw triple-brace template parameters"] = {
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 = "Raw template parameters",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Pages with DEFAULTSORT conflicts"] = {
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 = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Pages with DISPLAYTITLE conflicts"] = {
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 = "DISPLAYTITLE conflicts",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Pages with raw sortkeys"] = {
description = "Pages on which a sortkey has been used with a raw category.",
additional = "For example, {{code|[[<nowiki/>Category:IPA symbols|B]]}}." ..
"\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 = "Raw sortkeys",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Pages with module errors"] = {
topright = "{{shortcut|CAT:E|CAT:ERR|CAT:ERROR}}",
description = "Pages that have errors in a [[Wiktionary:Scribunto|Lua]] module.",
additional =
"If entries are listed here for more than a day or two, the error should probably be reported at [[Wiktionary:GP|the Grease Pit]]. Memory errors are a common source of these errors; see the discussion at [[Wiktionary:Lua memory errors]]." ..
"\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 \"[[mw:Help:Dummy_edit#A_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%20module%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 ParserFunction errors]].",
breadcrumb = "Module errors",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Pages with ParserFunction errors"] = {
topright = "{{shortcut|CAT:PFE}}",
description = "Pages that have errors in a [[mw:Help:Extension:ParserFunctions|ParserFunction]] magic word.",
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 = "ParserFunction errors",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
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 = { "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး", "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["Category and label treatment requests"] = {
description = "Content categories which have been tagged with {{tl|cltr}}, a request for them to be renamed, merged, split or deleted.",
parents = { "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး", "Requests" },
can_be_empty = true,
hidden = 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 = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
}
raw_categories["Pages using catfix"] = {
description = "Pages that use the <code>[[MediaWiki:Gadget-catfix.js|catfix]]</code> gadget.",
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 = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Pages calling Template:minitoc"] = {
description = "Pages that display a mini table of contents by calling {{tl|minitoc}}.",
additional = "This is used on very large pages with many entries, to assist with navigation.",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Categories calling Template:auto cat"] = {
description = "Categories that have been placed in another category by calling {{tl|auto cat}}.",
additional =
"This is the preferred way for categories to be subcategorized. The chief reason for this category is to facilitate the finding of categories which are not using {{tl|auto cat}} through the use of negative searches (e.g. qualifying a search with {{code|-incategory:\"{{PAGENAME}}\"}}).",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Categories with categories using raw markup"] = {
description =
"Categories that have been placed in another category using raw wiki markup (e.g. {{cl|Wiktionary}}). They should be added to the [[Module:category tree|category tree]] data instead.",
parents = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
can_be_empty = true,
hidden = true,
}
raw_categories["Documentation subpages"] = {
description = "Documentation subpages of templates and modules.",
parents = "Template documentation",
}
raw_categories["Orphaned documentation subpages"] = {
description = "Documentation subpages whose main page was deleted, leaving the documentation orphaned.",
additional = "Pages whose documentation page was created before the main page was created will also appear here. These should not be deleted; a null edit (edit with no changes) should fix this.",
parents = {"Documentation subpages", "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး"},
breadcrumb_and_first_sort_base = "Orphaned",
can_be_empty = true,
}
raw_categories["Template documentation"] = {
description = "Pages and categories relating to template documentation.",
parents = "ဝစ်ရှင်နရီ",
}
raw_categories["Templates and modules needing documentation"] = {
preceding = "{{also|:Category:Templates and modules with outdated documentation}}",
description =
"[[Wiktionary:Templates|Templates]] and [[Wiktionary:Modules|modules]] that require a documentation subpage.",
additional = "See [[Help:Documenting templates and modules]] for more information.",
parents = {"Template documentation", "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး"},
can_be_empty = true,
}
raw_categories["Templates and modules with outdated documentation"] = {
preceding = "{{also|:Category:Templates and modules needing documentation}}",
description =
"[[Wiktionary:Templates|Templates]] and [[Wiktionary:Modules|modules]] whose documentation is out of date.",
additional = "See [[Help:Documenting templates]] for more information.",
parents = {"Template documentation", "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး"},
can_be_empty = 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 = "ဝစ်ရှင်နရီ ထိန်းသိမ်းရေး",
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 }