Template talk:Sclass

Further deprecation of the unhyphened templates
I have updated the code for deprecated templates sclass, sclass2. I have added some extra's to make deprecation more easy.

How to deprecate. In the long run, templates, should be replaced by the hyphenated sclass-, sclass2-. Core difference is that the hyphen-templates create a link to a hyphened page:
 * Constellation-class frigate links to Constellation class frigate
 * Constellation-class frigate links to Constellation-class frigate

In both templates (hyphened/unhyphened), the text shown for the link is the same: hyphened.

In non-mainspace pages. The replacement is not possible in pages like archives, userpages and talkpages. For this reason, I have created separate code that serves these deprecated templates, and can stay there untouched forever: Template:Sclass/core/deprecated. With this, those pages will show the old as ever. They are not listed in maintenance categories, because there is no maintenance to be done. Then new code can develop further without having to keep old requirements in mind.

When replacing is bad. Meanwhile these templates should be removed from mainspace (at the moment, some 1100 transclusions are in mainspace). But blind replacement can have this disadvantage: when the old template shows a blue link, the new one may show a red link. This is undesired, and requires editor's action. In short, we should create the blue hyphened link, and then replace.

Categories and warnings. Maintenance messages and categorisation only happens in mainspace, the other spaces are supposed to stay unchanged (cannot do maintenance there). These "potential blue link to red link changes" are categorised in. Also, an article with the old template will show a warning in when this is the case. (No warning says: old s can be replaced without damage). The maintenance categories are together in

-DePiep (talk) 21:48, 21 March 2018 (UTC)
 * Checks to salvage blue links over red links has been removed: too expensive. Currently probably under a dozen btw, no big loss. - DePiep (talk) 16:52, 22 March 2018 (UTC)

Category:Pages with too many expensive parser function calls
after recent changes by, Naval warfare of World War I and Naval history of World War II are now in Category:Pages with too many expensive parser function calls and Category:Pages with script errors. Frietjes (talk) 14:34, 22 March 2018 (UTC)
 * Looking at this. - DePiep (talk) 15:01, 22 March 2018 (UTC)
 * -- removed expensive, secondary checks (after making use of them first ;-) ). - DePiep (talk) 16:50, 22 March 2018 (UTC)

Template issue?
This template is used for a pair of ships in a hatnote on Nilgiri-class frigate (2019), but for some reason the italics are reversed for both (ie: Foo-class). FYI - wolf  00:11, 12 April 2021 (UTC)
 * Not an issue. The hatnote italicizes everything unless overridden as it is in the italic markup from the  template rendering:
 * renders this:
 * The  css class applies   (line 1000 in MediaWiki:Common.css).  The italic wikimarkup produced by, overrides the italics to flip the wrapped text to normal font style (line 1004).  This is what we want because we want the ship-class name to be a different font style from that of the local running text – to be visually distinct.  In normal running text the ship-class name is italicized so in italic running text we want the ship-class name to be normal font.
 * —Trappist the monk (talk) 00:48, 12 April 2021 (UTC)
 * Ah of course, that makes sense. Thanks - wolf  01:30, 12 April 2021 (UTC)
 * —Trappist the monk (talk) 00:48, 12 April 2021 (UTC)
 * Ah of course, that makes sense. Thanks - wolf  01:30, 12 April 2021 (UTC)

Why does the template generate a leading space?
It's annoying and causes the appearance of double spacing. Am I missing something? RadioactiveBoulevardier (talk) 00:35, 25 February 2023 (UTC)
 * If one is to believe the edit history, that extra space may have been the result of this edit by Editor Jonesey95 in an attempt to fix some sort of linter error. What was the error?  Can it be fixed some other way?
 * —Trappist the monk (talk) 01:08, 25 February 2023 (UTC)
 * The error appears when 1 is absent, resulting in six ' marks in a row. It could be fixed with an if statement or possibly a zwsp. Be my guest. – Jonesey95 (talk) 07:22, 25 February 2023 (UTC)
 * That would be four not six, right? Fixed by changing   to.
 * +Benjamin Franklin-class submarine+
 * +Benjamin Franklin-class submarine+
 * —Trappist the monk (talk) 15:11, 25 February 2023 (UTC)
 * —Trappist the monk (talk) 15:11, 25 February 2023 (UTC)

Featured topics/König class battleships
Not sure what, but something with this template has broken this Featured topic box. Harrias (he/him) • talk 13:36, 4 April 2023 (UTC)
 * No. The template is not broken, the call to the template is broken:  .  The value assigned to positional parameter 3  is not a valid value (which is pretty much what the error message says).  Choose an appropriate value.  Did the help link not explain this well enough?
 * —Trappist the monk (talk) 14:14, 4 April 2023 (UTC)
 * Not my template, not my topic box. I saw it not working, assumed it had before, and so posted it here thinking it was a template issue. If someone has just screwed up the coding, fair enough. Harrias  (he/him) • talk 21:39, 5 April 2023 (UTC)