Module talk:nyms

Alt parameters
I thought my implementation of  parameters did work – at least in bhukuda. Where wasn't it working? — Eru·tuon 18:46, 14 February 2017 (UTC)
 * Your code assumed that  and   should be paired, which is not necessarily the case. —CodeCat 18:49, 14 February 2017 (UTC)
 * You mean lua. That's the way other templates with numbered parameters, such as, work. What is a case in which it would not hold true? I thought lua was only for terms. — Eru·tuon 18:58, 14 February 2017 (UTC)
 * Yes, 2 not 1. A case where it would not hold true is: . Note that  is missing; by default any holes in the numbering are removed, so   is "y", not "x"! —CodeCat 19:04, 14 February 2017 (UTC)
 * That's why I specified lua in the  table. That solves the problem. — Eru·tuon 19:06, 14 February 2017 (UTC)
 * Not quite. Because what if someone then writes ? —CodeCat 19:08, 14 February 2017 (UTC)
 * Then they would get an error because parameter  is required. — Eru·tuon 19:10, 14 February 2017 (UTC)
 * Okay, that's wrong. They would just get a prompt for a term: [Term?] . — Eru·tuon 19:13, 14 February 2017 (UTC)
 * You want  to be , and   to be  . The problem is that your code uses  , which expects tables without holes. It literally starts from 1 and counts upwards. But since there is no  , the loop terminates right away. This is noted in the documentation of Module:parameters:   does not play well with functions that expect tables without holes. That's why   exists. —CodeCat 19:19, 14 February 2017 (UTC)
 * Okay, well, I think having error messages for empty terms is useful. It is not desirable to have instances of a nyms template with [Term?] prompts. So I would like to combine the use of  with the error message for missing terms. — Eru·tuon 19:32, 14 February 2017 (UTC)
 * Why would it not be desirable? —CodeCat 19:35, 14 February 2017 (UTC)
 * Unless there is a purpose for an empty term parameter in an entry, it's useless, and useless things are undesirable. — Eru·tuon 20:05, 14 February 2017 (UTC)
 * It's not useless in, so whatever motivation applies to it applies here too. —CodeCat 20:07, 14 February 2017 (UTC)

Testing for singular and plural

 * would it be possible to update the module so that it operates as follows?


 * If a template has multiple parameters, e.g.,, then display "Synonyms:".
 * If a template has only one parameter, e.g.,, then display "Synonym:".

— SGconlaw (talk) 09:56, 16 June 2018 (UTC)


 * Of course, done:
 * Wyang (talk) 21:51, 17 June 2018 (UTC)
 * Wyang (talk) 21:51, 17 June 2018 (UTC)
 * Wyang (talk) 21:51, 17 June 2018 (UTC)
 * Wyang (talk) 21:51, 17 June 2018 (UTC)


 * Great, thanks! — SGconlaw (talk) 23:54, 17 June 2018 (UTC)

Suggested tweak
, currently the template displays "Synonym" if there is only one term, which is correct. I think it might be useful to be able to use the template (and, of course) with thesaurus links as well, like this:. If you think this is a good idea, would it be possible to tweak the template so that if the only entry is a thesaurus link that begins with  the template displays the word "Synonyms"? — SGconlaw (talk) 15:26, 5 January 2019 (UTC)

Or, just thinking aloud, another possibility would be for the template to be able to achieve the following:


 * → " Synonyms: see Thesaurus:happy"
 * → " Synonyms:, , ; see also Thesaurus:happy"

— SGconlaw (talk) 15:29, 5 January 2019 (UTC)
 * I like your last idea more. The module can figure out whether something is a term or a Thesaurus link based on the prefix. It would make the format more universal. There are a few details to work out though:
 * What if the Thesaurus link isn't the last one in the list?
 * The module allows you to specify qualifiers, alternative display forms and transliterations for each of the items. What happens when someone specifies these for a Thesaurus link?
 * —Rua (mew) 17:31, 5 January 2019 (UTC)
 * I think it makes sense for the Thesaurus link to always be the last item in a list. I don't know if this can be done automatically by the module – seems like that might be complicated. Maybe we just have to put a note on the appropriate template description pages to tell editors to do so. Qualifiers, alternative display forms and transliterations shouldn't apply to Thesaurus links. — SGconlaw (talk) 19:17, 5 January 2019 (UTC)

Don't know how it's gonna work out, but I like the idea. Per utramque cavernam 19:21, 5 January 2019 (UTC)
 * +1 The module could automatically put the thesaurus link at the end, but I think it'd be good editing practice to always put it at the end. – Jberkel 20:45, 5 January 2019 (UTC)

I implemented it:. If the Thesaurus link is not the last list item, or if you use named parameters with it, you get an error. —Rua (mew) 21:22, 5 January 2019 (UTC)
 * Nice & quick! I think it should still handle the case where there's only a thesaurus link. See Special:Diff/51188179/51205143. – Jberkel 03:39, 6 January 2019 (UTC)
 * Thanks, ! Yes, my suggestion was also for the situation where there is only a Thesaurus link to be implemented as well. In that case the word before the link should be “see”, not “see also”. — SGconlaw (talk) 10:56, 6 January 2019 (UTC)
 * Fixed. —Rua (mew) 11:46, 6 January 2019 (UTC)
 * Excellent! Thanks. — SGconlaw (talk) 12:29, 6 January 2019 (UTC)

I've made the template allow multiple thesaurus links as long as they are at the end. This fixes a module error in ineffable, which has. Either that, or I think a more helpful error message in such a case would be something like "You only get to add one Thesaurus link". — Eru·tuon 20:54, 6 January 2019 (UTC)
 * It makes more sense to allow multiple Thesaurus links, if there is already a need for it. —Rua (mew) 21:34, 6 January 2019 (UTC)

Links to entries will now be separated by semicolons rather than commas if any of the entry names contains a comma (see this discussion). Maybe the same should be done for Thesaurus links, but it's an unlikely scenario so I'm not doing it yet. — Eru·tuon 02:52, 8 January 2019 (UTC)

Multiple thesaurus links not arranged alphabetically
Why does end up producing this?

Shoudn't the thesaurus links be arranged alphabetically? — SGconlaw (talk) 18:08, 3 April 2019 (UTC)
 * Well, the order should at least be preserved, not reversed. Fixed. — Eru·tuon 18:14, 3 April 2019 (UTC)
 * Thanks! — SGconlaw (talk) 18:15, 3 April 2019 (UTC)

langcode prefix problem
the new functionality you implemented does not work properly, where it now requests for a term instead, see for example 月份. – Wpi (talk) 11:50, 24 June 2023 (UTC)