Wikipedia talk:Shortdesc helper

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

WikiProject Short descriptions  
WikiProject iconThis page is within the scope of WikiProject Short descriptions, a collaborative effort to improve the coverage of short descriptions in articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
 

Display both manual and auto SDs[edit]

Is it possible to show both the manual SD and the auto SD that the page would have if not for the manual override? I’m not sure if this is a reasonable request technically or conceptually, but I feel it would help with both checking that new auto SDs are functioning ok, as well as for editors to consider a change from the manual SD (many auto SDs have matured a lot since most manual SDs have been written). — HTGS (talk) 01:52, 31 August 2021 (UTC)[reply]

Technically this can be done by removing the manual SD from the page text, and parsing it using the API with action=parse&prop=properties. – SD0001 (talk) 16:34, 5 September 2021 (UTC)[reply]
@HTGS: Sorry, I just now saw this. I already have this functionality, which lets me, e.g., see both SDs at Wikipedia:Short description. Look at the last two bits of my CSS, which is what does the magic. I do not remember whence I stole this, but I seem to remember changing the color from whatever it originally used. — JohnFromPinckney (talk / edits) 07:09, 27 October 2021 (UTC)[reply]

Feature request: Descriptive edit summary for "none"[edit]

I propose that if a SD "none" is added, the following or similar edit summary is added: "Changing short description from "foo" to none because the title is sufficiently descriptive that no explanation of the article scope is needed (WP:SDNONE)." And maybe also add a similar inline comment in the wikicode. I've had one or two talk page messages like this because editors don't understand what "none" means. Sandstein 19:39, 5 November 2021 (UTC)[reply]

Additional dash to enDash conversion request[edit]

Galobtter, would it be feasible to include a "dash to enDash" conversion for variations of dates similar to (65–8 BC) as seen here? There aren't many like that, but they can easily be missed, and perhaps worthy of a few lines of code. See nuances in calendars per MOS:OSNS. Thanks! — WILDSTARtalk 12:10, 7 November 2021 (UTC)[reply]

This page has deliberately no description[edit]

On pages with {{short description}}, I see the text This page has deliberately no description. Shouldn't it be This page deliberately has no description? – Joe (talk) 11:48, 6 December 2021 (UTC)[reply]

Joe Roe, yes! It's unfortunate that only those who have the gadget installed actually see the message. After adding |Short description=None here, it was "deliberately" (pun intended) reverted.  :-) — WILDSTARTALK 18:37, 29 December 2021 (UTC)[reply]
Or this page has—deliberately—no description, I suppose... @Galobtter:. – Joe (talk) 20:40, 29 December 2021 (UTC)[reply]
The first suggestion sounds better to me (This page deliberately has no description). MB 21:15, 29 December 2021 (UTC)[reply]
Yes that was a joke. – Joe (talk) 11:27, 30 December 2021 (UTC)[reply]
I'd suggest This page intentionally has no description. Note that since it is a complete sentence, it should include terminal punctuation.--NapoliRoma (talk) 23:17, 29 December 2021 (UTC)[reply]
Will fix Galobtter (pingó mió) 05:48, 1 January 2022 (UTC)[reply]

Show missing description on drafts[edit]

@Galobtter: Hello! I think it would be a good idea to show the "missing article description" on drafts, so that a short description can be easily added to them. This would change showMissing's namespace check on line 1102 from namespace === 0 to (namespace === 0 || namespace === 118). What do you think? Tol (talk | contribs) @ 19:55, 5 January 2022 (UTC)[reply]

Not working on draft pages[edit]

Shortdesc helper does not seem to be available on draft pages without a short description, so have to add them manually. Drafts are intended for mainspace, so should get a short description, and when checking through the categories, it is useful to set the sd viewer to show sds · · · Peter Southwood (talk): 08:08, 17 March 2022 (UTC)[reply]

@Pbsouthwood: I already requested this in § Show missing description on drafts above, so I'll combine these sections. Because it's been more than two months without a reply, I'll make an edit request to implement this change. Tol (talk | contribs) @ 22:22, 18 March 2022 (UTC)[reply]

2022-03-18 edit request[edit]

Please change var showMissing (currently on line 1101) as follows.

From:

var showMissing = (
	namespace === 0 &&
	( !isRedirect || ( isRedirect && options.AddToRedirect ) )
);

To:

var showMissing = (
	( namespace === 0 || namespace === 118 ) &&
	( !isRedirect || options.AddToRedirect )
);

This implements the change discussed above (prompting to add a shortdesc on drafts), and also improves the logic of the redirect checking that follows. Tol (talk | contribs) @ 22:30, 18 March 2022 (UTC)[reply]

 Done @Tol: this is live, please ping if any issues. — xaosflux Talk 10:37, 24 March 2022 (UTC)[reply]
Thanks! Tol (talk | contribs) @ 14:51, 24 March 2022 (UTC)[reply]

Reloading[edit]

@Galobtter: Sometimes this gadget reloads the page unnecessarily, for example when exporting the short description. It'd also be nice if it didn't reload the page after editing or adding the short description - it could just update the short description displayed. ― Qwerfjkltalk 21:32, 13 January 2022 (UTC)[reply]

Interface-protected edit request on 20 January 2022[edit]

Change: 'This page has deliberately no description.'

To: 'This page intentionally has no description.'

Per: this discussion. Thanks. – Jonesey95 (talk) 04:11, 20 January 2022 (UTC)[reply]

 Done. Writ Keeper  16:34, 20 January 2022 (UTC)[reply]

Bug report: helper should preserve 1= when present[edit]

See this edit, in which the SD helper gadget deleted |1=, breaking the short description. – Jonesey95 (talk) 19:49, 12 February 2022 (UTC)[reply]

Pinging Galobtter. Let me know if you want this reported in some other way. – Jonesey95 (talk) 06:20, 16 February 2022 (UTC)[reply]

Option to Disable Automatic Capitalization[edit]

Hello! I have briefly read through the capitalization discussion here and on Wikipedia talk:Short description, and refreshed myself on the standards between Wikipedia and Wikidata. Seeing as exceptions occur, should there perhaps be an option to disable automatic capitalization locally (even if enabled by default)? I just encountered this issue when adding a short description beginning with the word "blog," which should be lowercase when beginning a phrase, just as vlog, iPhone, macOS, c., etc. would be. Top5a (talk) 20:10, 22 February 2022 (UTC)[reply]

I don't think this would be a good idea. "Blog" should be capitalized when it is the first word of a short description, and you are not the only person who would mistakenly think that a given word should be an exception. In {{Short description/lowercasecheck}}, the only exceptions we have needed to add so far are c. , gTLD, iMac, iOS, iPad, iPhone, iTunes, macOS, none, pH, and pH-dependent. That short list suffices for millions of articles with short descriptions. Editors can override the default capitalization with a second edit very easily. Adding an option for editors to override the default capitalization with this tool would just add more articles to Category:Pages with lower-case short description unnecessarily, and cause editors to have to do additional cleanup work. – Jonesey95 (talk) 20:26, 22 February 2022 (UTC)[reply]
OK -- thank you for the information! Top5a (talk) 20:41, 22 February 2022 (UTC)[reply]

Auto short descriptions with a value of "none"[edit]

Hi, I believe the helper could be improved when it comes to auto short descriptions from templates, typically infoboxes. It seems that when they are set to "none", the short desc helper does not display the handy message "This page intentionally has no description." on the constituent pages where the template is used; it displays the same text encouraging a user to add/import a description. This is a surprising result, given that setting it to anything else shows that the description is automatically generated and would need to be overridden to be changed.

I think having that message appear would be helpful so we can (1) show that whole swaths of articles should not have short descriptions and (2) do so without having to add {{Short description|none}} to every one of the pages in the group.

As an example, {{Infobox Olympic event}} defaults its short desc to "none". Basque pelota at the 1900 Summer Olympics encourages me to add a short description, whereas Archery at the 1904 Summer Olympics shows the "intentionally blank" message after I manually placed {{Short description|none}}. Thrakkx (talk) 16:38, 23 February 2022 (UTC)[reply]

The problem, of course, is that the page itself really does not have a Short description and so it is "correct" to offer the Wikidata description — just as for any page where nothing has been set. It would help if the SD helper could detect that the page would have the SD set (to none or otherwise) by a template, but that would involve an additional API call to check the evaluated output of the page as well as a check of the page source — GhostInTheMachine talk to me 20:23, 23 February 2022 (UTC)[reply]
I see, so this would not be a practical improvement? Thrakkx (talk) 21:44, 23 February 2022 (UTC)[reply]

Space after the template name[edit]

@Galobtter: Please could the gadget allow for and fix stray spaces after the template name. See archived talk at Wikipedia_talk:Shortdesc_helper/Archive_1#Bug:_previous_SD_not_recognized. Editing a SD in these cases will add a second template leaving the "bad" one in place — GhostInTheMachine talk to me 09:45, 9 March 2022 (UTC)[reply]

Option for Colorization if Mismatch between Page and Wikidata[edit]

I current have the setting checked for always show Wikidata description, such that I can visually compare a page to its Wikidata description without having to check the maintenance category for a match.

Is there a way to add an option/flag to colorize the description in case of mismatch, such as how pink is used if there does not exist a corresponding entry on Wikidata? Thanks! Top5a (talk) 09:26, 9 April 2022 (UTC)[reply]

Force (suggest?) first letter to lowercase when exporting to Wikidata project[edit]

I have had several reverts occur on Wikidata on account of conflicting policies between Wikidata and English Wikipedia on the topic of first letter capitalization. As Wikidata policy is to have descriptions begin with lowercase in general (cf. WikiData:Help:Description#Capitalization), it seems as though this tool should force a lowercase first character when exporting to Wikidata, along with the already extant forced capitalization for the corresponding English Wikipedia short description. Now, for proper nouns, it should not be forced, so perhaps instead there should be a popup or separate entry box for Wikidata export within the tool, such that the user could set the proper capitalization prior to export. On a side note, Category:Short_description_matches_Wikidata is case-insensitive already, so no changes are required there. Thanks! Top5a (talk) 18:22, 9 April 2022 (UTC)[reply]

You could change MediaWiki:Gadget-Shortdesc-helper.js#L-627, or something around there - I think confirmation would be great (and for when it lower-cases the short description when adding a new one to Wikipedia and Wikidata). As I found recently, lowercase-first words are far less common than uppercase-first words. ― Qwerfjkltalk 20:27, 9 April 2022 (UTC)[reply]
Hi! OK, what I am thinking is that when a user clicks to Export, if Wikidata is the selected adapter, a popup will occur with an editable textbox pre-populated with the string, but with the first character automatically changed to lowercase. There will be text over this textbox that states to confirm the Export to Wikidata, pleasure ensure that only proper noun capitalization is used (with a reference link to WikiData:Help:Description#Capitalization). Then, an Export and Cancel button are at the bottom. Does this sound reasonable? I have not performed Lua programming before on Wikipedia, and am a neophyte on Wikipedia and Wikidata, but it does not sound difficult for me or the maintainer to do. If I do this, do I then ping the maintainer (I believe it is @Galobtter) with a pull request? Thanks! Top5a (talk) 02:10, 10 April 2022 (UTC)[reply]

Appears to pull incorrect description at times?[edit]

Just a note to self during debugging, need to investigate pages such as Shanghai maglev train for why the short description is being pulled from a sidebar tag, rather than from Short description.

To anyone else reading, if I make changes to my own scripting edits for this gadget (cf. the last three section topics here), is there a way to submit a pull request on Wikipedia? I am not sure how that works. If not, no problem. Thanks! Top5a (talk) 19:25, 21 April 2022 (UTC)[reply]

@Top5a, you could write an edit request - click "view source" on the code and there should be a button to do so. If it's a non-controversial change, any interface admin could do it. Qwerfjkltalk 19:29, 21 April 2022 (UTC)[reply]
Great! Thank you so much! Appreciate your helpful and prompt replies here, @Qwerfjkl! Have a good day! Top5a (talk) 20:02, 21 April 2022 (UTC)[reply]
Fixed with this edit to the sidebar. Nearly all infoboxes and sidebars should use |2=noreplace. – Jonesey95 (talk) 22:49, 21 April 2022 (UTC)[reply]
Hello, again, @Jonesey95! Thank you! Hmm.. so, this tool should still have not pulled that replacement, right? Or at least indicated a conflict to the user? Top5a (talk) 00:02, 22 April 2022 (UTC)[reply]
The tool, and the short descriptions in that article, were working as designed. The "noreplace" option exists because in the developers' infinite wisdom, they decided that the last short description to appear in the article's wikicode is chosen by the Wikimedia software as the page's SD, but in our infinite wisdom as English Wikipedia volunteer editors, we chose to place our manual SDs at the top of each article. See WP:SDPLACE for details. – Jonesey95 (talk) 02:58, 22 April 2022 (UTC)[reply]
Gotcha -- thank you for that info! Well, even though Wikipedia and Wikidata are opposed on quite a few things wrt short descriptions, it just leads to a few areas in which the tool could use a few updates (seeing as the tool bridges the two projects), which I will probably add and test for fun (different colouring depending on mismatch, capitalization differentiation between the two, conflict between multi-short desc listings within an article 1st vs last, etc.). This way, users of the tool on Wikipedia will not accidentally break Wikidata (e.g. Wikipedia breaking Wikidata during export, and vice versa during import), and will be aware of conflicts such as that (perhaps with even some tooltips within the tool itself). Top5a (talk) 04:19, 22 April 2022 (UTC)[reply]
If you're tinkering, I would find it useful if the tool would show both the infobox-generated SD and the Wikidata SD, and let me choose whether to Override the infobox-generated SD with a manual SD or Import / Import and Edit the Wikidata SD. Right now, the tool lets me do only the former if there is an infobox-generated SD (and doesn't show the Wikidata SD). Often, the Wikidata SD is better than the infobox-generated SD, but I can't see it with the tool, so it is not easy to import. Let me know if you need a clearer explanation. – Jonesey95 (talk) 05:22, 22 April 2022 (UTC)[reply]
Noted! I will add that, as well. This will be my first time working on a Module here (the next thing I want to fix has to do with a template problem between coordinate templates between English Wikipedia and Wikidata, wherein a Wikidata bot changed their schema and broke the template on English Wikipedia, and Wikidata does not wish to revert the mangling). Top5a (talk) 05:31, 22 April 2022 (UTC)[reply]
I have reviewed WP:SDPLACE, and will probably start experimenting when I get some free time soon. I will be working through my item list one by one, as well as your suggestion, which I think is great. By the way, I do have one more question: after this is done, should there perhaps be some talk of creating a bot and/or maintenance category for templates that include short descriptions without |2=noreplace?
I am looking at this page Category:Templates with short description, though I am unsure as to how to view the Lua which generates that category. Is there some link in the sidebar to view the module code that I am missing? Top5a (talk) 19:48, 22 April 2022 (UTC)[reply]