Jump to content

Template talk:Sclass

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Template issue?

[edit]

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)[reply]

Not an issue. The hatnote italicizes everything unless overridden as it is in the italic markup from the {{sclass}} template rendering:
{{hatnote|For the namesake {{Sclass|Leander|frigate|0}} predecessors, see {{Sclass|Nilgiri|frigate (1972)|1}}}}
renders this:
'"`UNIQ--templatestyles-00000010-QINU`"'<div role="note" class="hatnote navigation-not-searchable">For the namesake [[Leander-class frigate|''Leander''-class]] predecessors, see [[Nilgiri-class frigate (1972)|''Nilgiri''-class frigate (1972)]]</div>
The hatnote css class applies font-style: italic (line 1000 in MediaWiki:Common.css). The italic wikimarkup produced by {{sclass}}, 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)[reply]
Ah of course, that makes sense. Thanks - wolf 01:30, 12 April 2021 (UTC)[reply]

Why does the template generate a leading space?

[edit]

It's annoying and causes the appearance of double spacing. Am I missing something? RadioactiveBoulevardier (talk) 00:35, 25 February 2023 (UTC)[reply]

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)[reply]
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)[reply]
That would be four not six, right? Fixed by changing '' {{{1}}}'' to {{#if:{{{1|}}}|''{{{1}}}''}}.
+{{sclass|Benjamin Franklin|submarine}}+
+[[Benjamin Franklin-class submarine|''Benjamin Franklin''-class]] [[submarine]]+
+Benjamin Franklin-class submarine+
Trappist the monk (talk) 15:11, 25 February 2023 (UTC)[reply]

Not sure what, but something with this template has broken this Featured topic box. Harrias (he/him) • talk 13:36, 4 April 2023 (UTC)[reply]

No. The template is not broken, the call to the template is broken: {{sclass|König|battleship|6}}. The value assigned to positional parameter 3 (6) 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)[reply]
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)[reply]

New value needed

[edit]

I went to edit the article Visby-class corvette, wherein I first encountered this template.

There is a punctuation error in the article, and the template's current options do not allow me to fix it (by adding a suspended hyphen). For the second sentence to be correct and in compliance with the Wikipedia Manual of Style (See MOS:SUSPENDED for details), it should read:

"...after the Göteborg- and Stockholm-class corvettes."

I would like to see an appropriate option added. Thanks! 1980fast (talk) 22:30, 30 August 2024 (UTC)[reply]

I don't think that there is sufficient need to justify the work necessary to implement such a specialized option. You can do this:
It is the latest class of corvette adopted by the navy after the {{sclass|Göteborg|corvette|5}}- and {{sclass|Stockholm|corvette|0}} corvettes.
It is the latest class of corvette adopted by the navy after the Göteborg- and Stockholm-class corvettes.
Trappist the monk (talk) 00:58, 31 August 2024 (UTC)[reply]
Indeed, much simpler. I clearly overthought it. Thanks! 1980fast (talk) 19:27, 31 August 2024 (UTC)[reply]

Why no en dash in compound class names?

[edit]

Greetings and felicitations. In New Orleans-class the punctuation is a hyphen, instead of an en dash as per MOS:SUFFIXDASH. Why is this so? —DocWatson42 (talk) 13:02, 10 October 2024 (UTC)[reply]

I am the victim of a series of dreadfully dreary and uninspiring English teachers so I can't answer definitively. The template as you wrote it:
{{Sclass|New Orleans|cruiser|0}}New Orleans-class
is the adjectival form that modifies the following ship-type noun. When used without a ship type, there should not be a hyphen between the class name and the word class:
{{Sclass|New Orleans|cruiser|4}}New Orleans class
Also, the hyphenated form matches the article title. If you want to change this template then you must also move the ~3500 articles to which it links – that's a very crude search so the article count could be way off.
Trappist the monk (talk) 14:40, 10 October 2024 (UTC)[reply]
I'm sorry—I took that example from USS Wichita (CA-45), specifically the second sentence of the lede: "The last American cruiser designed to meet the limits of the London Naval Treaty, she was originally intended to be a New Orleans-class heavy cruiser". You can see in that case that the en dash is warranted, assuming the hyphen is correct in the first place. —DocWatson42 (talk) 12:17, 11 October 2024 (UTC)[reply]
No, I cannot see in that case that the en dash is warranted, assuming the hyphen is correct in the first place. As I understand it, New Orleans-class is an adjectival noun modifying the heavy cruiser noun. In which case, also as I understand it, the hyphen is correct. But did you write what you meant to write? the en dash is warranted, [but] the hyphen is correct? You will probably need to find someone who was not the victim of piss-poor English teachers to definitively explain why we should or should not use en dash or hyphens in ship-class names. MOS:SUFFIXDASH is part of WP:MOS so perhaps start a discussion at WT:MOS. If you do, please post a link to that discussion here.
Trappist the monk (talk) 13:43, 11 October 2024 (UTC)[reply]
See Hyphen#Prefixes and suffixes and en dash (specifically in this case Dash#Attributive_compounds) for usage. —DocWatson42 (talk) 14:46, 11 October 2024 (UTC)[reply]

Collision between template output results and manual of style

[edit]

Hello,

at least the default behaviour of this template seems to collide with recommendations in the manual of style, section MOS:SEAOFBLUE, as it makes for two different wikilinks that are not visually distinguishable from one. Wouldn't it be sensible to make the "format 1" default and remove "format none" and "format 3" altogether? As a reader, I'm often somewhat bothered by not being able to tell whether you have 1, 2 or even 3 links in a blue string of words. Regards, Grand-Duc (talk) 21:31, 27 November 2024 (UTC)[reply]