Template talk:SD

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Adding some parameters to the template[edit]

I'm trying to localize Twinkle for Commons. For CSD function, I've tweaked Twinkle a little bit so that it'll work with this template. The only problem is additional parameters for G8; for example, Twinkle shows a specific option for deleting orphan talk pages with G8. Its alias should be "talk", but "talk" is not a valid speedy deletion criterion; G8 is. The only way I can think of is to add another line of parameters to the #switch function, all linking to G8 by default. Although this change will not break anything, I want to know if anyone knows a better, cleaner way to do it. If there are no suggestions/comments in a few days, I'll do it the way I explained above. Ahmadtalk 11:02, 14 February 2020 (UTC)[reply]

Have twinkle use 'G8' as alias. 'talk' doesn't imply speedy eligibility; 'orphan talk' does. --Zhuyifei1999 (talk) 19:03, 15 February 2020 (UTC)[reply]
@Zhuyifei1999: I do; the point is that we have more than one "G8" options. For example, on talk pages, Twinkle also shows an option for orphan talk, based on G8. Although it is based on G8, it is a separate option for talk namespace, not all namespaces. Maybe I should just drop these options, as Twinkle automatically shows the general "G8" on all namespaces? Ahmadtalk 13:02, 16 February 2020 (UTC)[reply]
How about "G8-orphan-talk"? Dropping extras also sounds fine to me --Zhuyifei1999 (talk) 19:15, 16 February 2020 (UTC)[reply]
That's also a good suggestion, thanks. The alias is easily changeable, I'm more focused on the work that has to be done on-wiki. Even after editing this template, the result won't be as satisfying as I like it to be. I'll just drop extra options for now. Ahmadtalk 20:52, 16 February 2020 (UTC)[reply]

We have another problem: Twinkle checks if a page has proper delete summary in its speedy deletion template. It actually checks for span id="delete-reason". If the template doesn't have this id, Twinkle will not speedy delete the page. As a result, I tweaked the template a little bit here. There are no visible changes applied; it's an invisible piece of code that helps Twinkle detect the deletion reason and validate it. Ahmadtalk 15:36, 19 February 2020 (UTC)[reply]

And, if we want to add multiple reasons like "found elsewhere on the web" or "no indication of publication under a free license", we should add parameters to the template. Twinkle gets its reasons from this template, this template gets them from the policy page. So, the only way to implement this is to edit this template. I suggest adding multiple reasons based on MediaWiki:Deletereason-dropdown, things like: "F1-WEB", "F1-IND", "F3-DW", "F3-SS" etc. Ahmadtalk 15:08, 20 February 2020 (UTC)[reply]

All moved to Template:SD/T. Ahmadtalk 18:58, 22 February 2020 (UTC)[reply]

Edit request[edit]

{{Edit request}}

I saw one user write {{SD|c3}} so {{#switch:{{{1|}}} would be good if it switched to {{#switch:{{uc:{{{1|}}}}} to take account for that.Jonteemil (talk) 08:14, 22 April 2020 (UTC)[reply]

✓ Done Thank you! Ahmadtalk 08:26, 22 April 2020 (UTC)[reply]
@Ahmad252: Thank you :).Jonteemil (talk) 08:28, 22 April 2020 (UTC)[reply]

{{edit request|temppro=1}}

Please apply the following diff:

Template:SD
--- a/Template:SD.mw
+++ b/Template:SD.mw
@@ -1,16 +1,15 @@
-<noinclude>{{Don't delete this template}}
-
-</noinclude>{{#switch:{{uc:{{{1|}}}}}
+{{Don't delete this template}}
+<onlyinclude>{{#switch:{{uc:{{{1|}}}}}
 | C1= {{Bad name|{{#if:{{{2|}}}|Category:{{{2}}}}}|category=<includeonly>{{{category|[[Category:Other speedy deletions|{{REVISIONTIMESTAMP}}]]}}}</includeonly>}}
 | F1= {{Copyvio|{{#if:{{{2|}}}|{{{2}}}}}|source={{#if:{{{source|}}}|{{{source}}}}}|X-To-DR-RegExp=<nowiki>/\{\{\s*(SD)\s*(?:\|\s*(?:(?:1|source)\=)?)?([^\n]*)\}\}/</nowiki>|category=<includeonly>{{{category|[[Category:Copyright violations|{{REVISIONTIMESTAMP}} ]]}}}</includeonly>}}
 | F8= {{Duplicate|{{#if:{{{2|}}}|{{{2}}}}}|X-To-DR-RegExp=<nowiki>/\{\{\s*(SD)\s*(?:\|\s*(?:1\=)?)?([^\n]*)\}\}/</nowiki>|category=<includeonly>{{{category|[[Category:Duplicate|{{REVISIONTIMESTAMP}} ]]}}}</includeonly>}}
-| #default= {{speedydelete|1={{#switch:{{uc:{{{1|}}}}}|GA1|GA2|C2|COM1|F2|F3|F4|F5|F6|F7|F9|F10|T1|T2|U1|U2|U3|G1|G2|G3|G4|G5|G6|G7|G8|G9|G10|G11=[[COM:CSD#{{uc:{{{1}}}}}|CSD {{uc:{{{1}}}}}]] ({{lcfirst:{{#lst:Commons:Criteria for speedy deletion|{{uc:{{{1}}}}}}}}}){{#if:{{{2|}}}|&#58; {{{2}}}|}}|#default={{{1|}}}{{{reason|}}}}}|X-To-DR-RegExp={{{X-To-DR-RegExp|<nowiki>/\{\{\s*(SD)\s*(?:\|\s*(?:(?:1|source)\=)?)?([^\n]*)\}\}/</nowiki>}}}|
+| #default= {{speedydelete|1={{#switch:{{uc:{{{1|}}}}}|GA1|GA2|C2|COM1|F2|F3|F4|F5|F6|F7|F9|F10|T1|T2|U1|U2|U3|G1|G2|G3|G4|G5|G6|G7|G8|G9|G10|G11=[[Special:MyLanguage/COM:CSD#{{uc:{{{1}}}}}|CSD {{uc:{{{1}}}}}]] ({{lcfirst:{{#lst:Commons:Criteria for speedy deletion|{{uc:{{{1}}}}}}}}}){{#if:{{{2|}}}|&#58; {{{2}}}|}}|#default={{{1|}}}{{{reason|}}}}}|X-To-DR-RegExp={{{X-To-DR-RegExp|<nowiki>/\{\{\s*(SD)\s*(?:\|\s*(?:(?:1|source)\=)?)?([^\n]*)\}\}/</nowiki>}}}|
 category=<includeonly>{{{category|[[Category:{{#switch:{{uc:{{{1|}}}}}
 |G10=Advertisements for speedy deletion
 |F2|F3|F4|F5|F6|G11=Copyright violations
 |F10=Personal files for speedy deletion
 |#default=Other speedy deletions
 }}|{{REVISIONTIMESTAMP}}]]}}}</includeonly>}}
-}}<noinclude>
-{{documentation}}
-</noinclude>
+}}</onlyinclude>
+{{Documentation}}
+<!-- Add categories to the /doc subpage and interwikis in Wikidata, not here! -->

in order to use Special:MyLanguage for links to COM:CSD (e.g.: Special:MyLanguage/COM:CSD), which redirects to the user’s language. — ExE Boss (talk) 23:20, 25 August 2021 (UTC)[reply]

✓ Done in revision 591769094. — ExE Boss (talk) 10:10, 17 September 2021 (UTC)[reply]