Giving function arguments in templates

Giving function arguments in templates

Hey cat, could you help me out with this template? User:Crom_daba/sh-noun

I'm trying to pass "noun" as the first argument to head_t in Module:User:Crom_daba/sh-headword along with other arguments that might be added when calling {{User:Crom daba/sh-noun}}, but clearly the template behaves the same as User:Crom_daba/sh-head as can be seen here. I'm guessing that my understanding of Module:parameters is faulty, how could I achieve this behaviour in the easiest way?

Crom daba (talk)21:15, 5 November 2016

It looks to me like you're duplicating {{head}}. Why?

CodeCat21:16, 5 November 2016

To automatize entering Serbo-Croatian transliteration, the bane of my existence.

Crom daba (talk)23:20, 5 November 2016

That doesn't seem like a very effective way of doing it. Why would you have to duplicate the whole template just for that?

CodeCat23:22, 5 November 2016
 

I would recommend looking at Module:sl-headword. Slovene has no transliterations, but many other aspects, such as the need to always provide an accented headword, are the same. I wrote the module some time ago and would probably do some things different now, but it's a start. I may actually bring it up to standard soon, and then you can take your code from it and adapt it to Serbo-Croatian.

CodeCat23:41, 5 November 2016

Because we need it done in the headword, and we need to transliterate in both directions, reworking {{head}} to handle this with through its normal transliteration mechanisms would be impractical.

As for writing the module, I just want it to function the same as the old template system for now, until we figure out what inflectional information we want to require in the headword.


The concrete problem I have is why {{User:Crom daba/sh-noun|head=gòblēn}}, which is defined as {{#invoke:User:Crom_daba/sh-headword|head_t|nouns}}, won't function the same as {{User:Crom daba/sh-head|nouns|head=head=gòblēn}} but rather as {{User:Crom daba/sh-head|head=head=gòblēn}}.

Crom daba (talk)00:24, 6 November 2016

Can you not just use the tr= parameter of {{head}}?

CodeCat00:33, 6 November 2016