www.fgks.org   »   [go: up one dir, main page]

Jump to content

Template talk:Short description/lowercasecheck: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
→‎ucfirst?: @Qwerfjkl "Ignore that last comment, clearly I'm to..." [Factotum]
→‎ucfirst?: should be lcfirst given the order of results
Line 3: Line 3:
:@[[User:Jonesey95|Jonesey95]]: Would <code><nowiki>{{First word|iOS, etc.|sep= ,}}</nowiki></code> → {{First word|iOS, etc.|sep= ,}} do the trick? Note the {{param|sep}} parameter treats its inputs as OR i.e. it looks for '_' or ',' not '_,' .&nbsp;&#8213;&nbsp;[[User:Qwerfjkl|<span style="background:#1d9ffc; color:white; padding:5px; box-shadow:darkgray 2px 2px 2px;">Qwerfjkl</span>]][[User talk:Qwerfjkl|<span style="background:#79c0f2;color:white; padding:2px; box-shadow:darkgray 2px 2px 2px;">talk</span>]] 21:55, 9 February 2022 (UTC)
:@[[User:Jonesey95|Jonesey95]]: Would <code><nowiki>{{First word|iOS, etc.|sep= ,}}</nowiki></code> → {{First word|iOS, etc.|sep= ,}} do the trick? Note the {{param|sep}} parameter treats its inputs as OR i.e. it looks for '_' or ',' not '_,' .&nbsp;&#8213;&nbsp;[[User:Qwerfjkl|<span style="background:#1d9ffc; color:white; padding:5px; box-shadow:darkgray 2px 2px 2px;">Qwerfjkl</span>]][[User talk:Qwerfjkl|<span style="background:#79c0f2;color:white; padding:2px; box-shadow:darkgray 2px 2px 2px;">talk</span>]] 21:55, 9 February 2022 (UTC)


== ucfirst? ==
== lcfirst? ==


Why doesn't this template just use <code>ucfirst</code> in a comparison to check if the first character is lowercase?
Why doesn't this template just use <code>lcfirst</code> in a comparison to check if the first character is lowercase?
<syntaxhighlight lang="wikitext">
<syntaxhighlight lang="wikitext">
{{ #ifeq: {{{1}}} | {{ucfirst:{{{1}}}}}
{{ #ifeq: {{{1}}} | {{lcfirst:{{{1}}}}}
| <!-- lowercase; extract first word and check against allowlist -->
| <!-- lowercase; extract first word and check against allowlist -->
| <!-- uppercase or uncased character; do nothing -->
| <!-- uppercase or uncased character; do nothing -->
Line 15: Line 15:
:[[User:Dinoguy1000|Dinoguy1000]], in case there's a situation where a valid lowercase word which is not in the allowlist is used; it's better to spot it in the tracking category than have some editor wonder why they can't fix the short description.<span id="Qwerfjkl:1712432606045:Template_talkFTTCLNShort_description/lowercasecheck" class="FTTCmt"> —&nbsp;[[User:Qwerfjkl|<span style="background:#1d9ffc; color:white; padding:5px; box-shadow:darkgray 2px 2px 2px;">Qwerfjkl</span>]][[User talk:Qwerfjkl|<span style="background:#79c0f2;color:white; padding:2px; box-shadow:darkgray 2px 2px 2px;">talk</span>]] 19:43, 6 April 2024 (UTC)</span>
:[[User:Dinoguy1000|Dinoguy1000]], in case there's a situation where a valid lowercase word which is not in the allowlist is used; it's better to spot it in the tracking category than have some editor wonder why they can't fix the short description.<span id="Qwerfjkl:1712432606045:Template_talkFTTCLNShort_description/lowercasecheck" class="FTTCmt"> —&nbsp;[[User:Qwerfjkl|<span style="background:#1d9ffc; color:white; padding:5px; box-shadow:darkgray 2px 2px 2px;">Qwerfjkl</span>]][[User talk:Qwerfjkl|<span style="background:#79c0f2;color:white; padding:2px; box-shadow:darkgray 2px 2px 2px;">talk</span>]] 19:43, 6 April 2024 (UTC)</span>
::Ignore that last comment, clearly I'm too tired to be editing. Pinging @[[User:Jonesey95|Jonesey95]].<span id="Qwerfjkl:1712432734867:Template_talkFTTCLNShort_description/lowercasecheck" class="FTTCmt"> —&nbsp;[[User:Qwerfjkl|<span style="background:#1d9ffc; color:white; padding:5px; box-shadow:darkgray 2px 2px 2px;">Qwerfjkl</span>]][[User talk:Qwerfjkl|<span style="background:#79c0f2;color:white; padding:2px; box-shadow:darkgray 2px 2px 2px;">talk</span>]] 19:45, 6 April 2024 (UTC)</span>
::Ignore that last comment, clearly I'm too tired to be editing. Pinging @[[User:Jonesey95|Jonesey95]].<span id="Qwerfjkl:1712432734867:Template_talkFTTCLNShort_description/lowercasecheck" class="FTTCmt"> —&nbsp;[[User:Qwerfjkl|<span style="background:#1d9ffc; color:white; padding:5px; box-shadow:darkgray 2px 2px 2px;">Qwerfjkl</span>]][[User talk:Qwerfjkl|<span style="background:#79c0f2;color:white; padding:2px; box-shadow:darkgray 2px 2px 2px;">talk</span>]] 19:45, 6 April 2024 (UTC)</span>
:::No worries, this made me double-check my own thinking and realize I'd suggested the wrong function for the logic as given. =) <span class=nowrap>「[[User:Dinoguy1000|<span style=color:#00f>ディノ</span><span style=color:#080>奴</span>]][[Special:Contributions/Dinoguy1000|<span style=color:#F90>千?!</span>]]」<sup>[[User talk:Dinoguy1000#top|☎ Dinoguy1000]]</sup></span> 03:38, 7 April 2024 (UTC)

Revision as of 03:39, 7 April 2024

Needs better word extraction than Template:first word

This template needs better word extraction than {{first word}}, which includes commas. This means that even though "iOS" is on the whitelist, the short description "iOS, macOS, and tvOS software" fails the check. – Jonesey95 (talk) 23:02, 6 February 2022 (UTC)[reply]

@Jonesey95: Would {{First word|iOS, etc.|sep= ,}} → iOS do the trick? Note the {{{sep}}} parameter treats its inputs as OR i.e. it looks for '_' or ',' not '_,' . ― Qwerfjkltalk 21:55, 9 February 2022 (UTC)[reply]

lcfirst?

Why doesn't this template just use lcfirst in a comparison to check if the first character is lowercase?

{{ #ifeq: {{{1}}} | {{lcfirst:{{{1}}}}}
| <!-- lowercase; extract first word and check against allowlist -->
| <!-- uppercase or uncased character; do nothing -->
}}

ディノ千?!☎ Dinoguy1000 18:11, 6 April 2024 (UTC)[reply]

Dinoguy1000, in case there's a situation where a valid lowercase word which is not in the allowlist is used; it's better to spot it in the tracking category than have some editor wonder why they can't fix the short description. — Qwerfjkltalk 19:43, 6 April 2024 (UTC)[reply]
Ignore that last comment, clearly I'm too tired to be editing. Pinging @Jonesey95. — Qwerfjkltalk 19:45, 6 April 2024 (UTC)[reply]
No worries, this made me double-check my own thinking and realize I'd suggested the wrong function for the logic as given. =) ディノ千?!☎ Dinoguy1000 03:38, 7 April 2024 (UTC)[reply]