![]() | This template was considered for deletion on 2011 December 24. The result of the discussion was "keep". |
|
|
This page has archives. Sections older than 730 days may be automatically archived by Lowercase sigmabot III when more than 5 sections are present. |
{{Native name list}} gives needless error when a pair is empty/absent, and the optional |italics2=no
is set.
OK:
blank/abs: ..|tag2=|name2=|italics2=no
-DePiep (talk) 08:48, 7 November 2022 (UTC)
{{native name list/sandbox|tag1=de|name1=Guten tag|tag15=fr|name15=Bonjour|tag23432=ja|name23432=こんにちは}}
produces
|tag1, name1, ..., tag23432, name23432=
for input.
{native name list/sandbox|tag1=|name1=|tag2=|name2=}
→{{#if:{{{tag1|}}}{{{tag2|}}}{{{name1|}}}{{{name2|}}}...|{native name list|tag1={{{tag1|}}}|name1={{{name1|}}}|...} }
{{native name list}}
inside an infobox template is {{infobox currency}}
. Why is it done that way instead of how it is done in other infoboxen where {{native name list}}
is the rvalue in a infobox parameter assignment? I think that the empty-list error message has value because it tells the editor that something is obviously missing. If {{native name list}}
must be inside the infobox code then perhaps there is a better way to suppress the empty-list error message than the brute-force method currently employed by the module sandbox: |_suppress_empty_error=yes
or some such.suppress_empty_error=yes
I understand and is an other solution for the issue I pointed out. Omit the unserscore btw: a regular parameter not in-module. (btw, I do not accept the anytext-construct that would effectuate |suppress=no
as a yes).|tag2, name2=
must be complete or an error message is due anywhere anytime. (2) But optional parameters like |italics3=no
are not an error when unused (unused because of pair3 being). This change is welcome. (4) Situation "all pairs empty" is not an error status: a pair is optional, so the first one is too. We're talking about a warning at best. I welcome this change; as said, the switch parameter is OK too (especially for in-infobox usge).{{Native name list}}
in an infobox. (To state the obvious, it is to standardise style & presentation over the transclusions, and to simplify article-editors input). Noone claimed a "must". Also, I don't like the tone that is suggesting I did something wrong without being able or clear describing what.True
|empty_list_error=
, where an explicit "no" (or "n" or "0" or similar) will turn off the error message. Still in sandbox, not yet live. — hike395 (talk) 06:24, 9 November 2022 (UTC)
|_suppress_empty_error=yes
because that says what the parameter/value pair does when present in the template. I included the leading underscore as an indicator that it isn't a parameter that should be used except in special cases, inside of an enclosing template for example, where general editors don't have access to {{native name list}}
. |empty_list_error=yes
, |empty_list_error=no
? What do those mean to a user? Make a list? Don't make a list?|suppress_empty_error=no
should mean to print an error message or not to print an error message (I'm assuming it would print an error message: it's a double negative).|_supress_empty_error=no
(or any other value the doesn't equate to yes
) actually suppressing the error message is not desired. Your alternative parameter |empty_list_error=yes
does not express an action; it is not an instruction to the template to do something so it would be better as |supress_empty_list_error=yes
or |ignore_empty_list_error=yes
which reads like a directive to control the template output. I think that suppress
is better than ignore
in this case because we are directing the template to mute the error message (so that we may ignore it).|expand=
does the same action for both |expand=yes
and |expand=no
??? ("Any value will have this effect"). One of the two is wrong, and must be prevented by code (not by documentation). DePiep (talk) 02:52, 10 November 2022 (UTC)
{{Yesno}}
or module:yesno" (read T/F, uc/lc, ..). Be explicit in documentation, also about a default if present. DePiep (talk) 03:03, 10 November 2022 (UTC) How about |empty_list_is_error=
? — hike395 (talk) 23:33, 9 November 2022 (UTC)
|supress_empty_list_error=yes
that you cannot stomach? For |empty_list_is_error=
the default is yes
so to mute the error message |empty_list_is_error=no
. I'm not sure that a negative value (no
) is as 'assertive' as a positive (yes
) value. And |empty_list_is_error=
isn't really a directive; for someone just reading the template invoke, what does |empty_list_is_error=yes
really mean? How does the template respond to that parameter? I think that |supress_empty_list_error=yes
more clearly indicates to this unfamiliar reader how the template will respond. Yeah, the reader should also read the template documentation, but will they?|suppress_empty_list_error=
, and changed its sense (i.e., "no" means make an error, "no" is default). Updated the test cases. Shall I make the sandbox live? — hike395 (talk) 02:41, 10 November 2022 (UTC)
{{native name}}
can have the very same new parameter (say |empty_list_is_error=
) with exactly the same functionalities :-) @Hike395 and Trappist the monk:. -DePiep (talk) 08:28, 10 November 2022 (UTC)
::We never made this go live. I can merge the old edit into the latest module. — hike395 (talk) 14:10, 27 May 2023 (UTC)
I've recently made an adjustment to use Module:List out of a desire to limit the "exposed surface" of the plainlist class (see API design), which will soon be TemplateStyled (see MediaWiki talk:Common.css/to do#Plainlist). See this diff for the changes. All the test cases I checked were green, but the comment "to avoid replacement count contaminating the output" (which I believe to be no longer relevant since we are no longer gsubbing) gave me pause on deploying. Izno (talk) 03:13, 8 December 2022 (UTC)
table.concat()
a sequence that has only one member. Because the live version wraps each sequence member in <li>...</li>
tags, for the case of only one language, the module uses string.gsub()
to remove those tags. string.gsub()
returns two values: the string (modified or not) and a count of the number of replacements that were made. If the module returns the result from a string.gsub()
operation, the calling template gets both return values. To prevent that, assigning the result from a string.gsub()
operation to a single local variable and then returning that variable prevents the extraneous count from being returned to the calling template.Could it be adapted so the above show 'Serbo-Croatian Cyrillic', 'Serbo-Croatian Latin', 'Serbian Cyrillic' and 'Serbian Latin' respectively, just like {{lang-sh-Cyrl}}, {{lang-sh-Latn}}, {{lang-sr-Cyrl}} and {{lang-sr-Latn}} do? –Vipz (talk) 12:51, 20 March 2023 (UTC)
Hello. Would it be possible to add support to define a different target from the text shown? For example, in my case in Slovene Wikipedia I would like to show 'francosko' (French, adverb) and link to 'francoščina' which is the name of the language. The IANA languages table translations are all adverbs in my case. I guess it would be handy to be able to link to another target in the English Wikipedia too. --TadejM my talk 07:13, 26 May 2023 (UTC)
would like to show 'francosko':
{{native name|fr|text|link=yes}}
→ ''text'' ([[francosko]])
→ text (francosko)'francosko' [to] link to 'francoščina':
[[:sl:francosko]]
is a redirect to [[:sl:francoščina]]
: francoskoI would like the links to point directly to the language name and bypass redirects. This is particularly the case because not all redirects have been created yet. If I add this module to a template (e.g. a highly visible one), not all links will be functional as many redirects don't exist yet. In addition, it is preferable to have articles mostly linked directly and not via redirects, because it improves user experience (seamless navigation and less risk of confusion). Another issue is that the 'lang' templates have been implemented with piped links, so this would also help with consistency. --TadejM my talk 05:54, 27 May 2023 (UTC)
|label={{ifeq|{{{label|}}}||[[francoščina|francosko]]}}
{{lang|fn=name_from_tag|fr|link=yes}}
→ [[francosko|francosko]]
(not sure why you do that)[[francosko]]
cleanly and easily redirects to francoščina so the |label=
manipulation in sl:Template:lang-fr seems extraneous.This is how these templates were implemented initially, so this preserves the initial format. I am a) not entirely convinced that redirect are superior to piped links and b) don't think I have community consensus to replace piped links with redirects. I agree that piped links containing the same target and displayed name are redundant, but I have not yet researched how to resolve this. In any case, this has not posed any practical issues so far. In my opinion, these templates should all function in the same manner, so having some of them as redirects is not preferable. --TadejM my talk 16:20, 27 May 2023 (UTC)
I was using this template when I came across an error, Spanish and French varieties don't appear, but English varieties do appear.
Here's an example of what I mean:
Input | Output |
---|---|
{{Native name|en-US|Bob}}
|
Bob (American English) |
{{Native name|en-CA|Bob}}
|
Bob (Canadian English) |
{{Native name|es-MX|Bob}}
|
Bob (Spanish) |
{{Native name|fr-CA|Bob}}
|
Bob (Canadian French) |
Can someone please make it so that the Spanish and French varieties appear just like the English varieties do? – Treetoes023 (talk) 02:53, 22 July 2023 (UTC)