Template talk:cardinalbox

Latest comment: 8 years ago by Saltmarsh in topic Transliteration

From Panda10 edit

Disucussing use of the template on the page for három :

It's a good idea. A few thoughts:

  1. The first line is Hungarian cardinal numbers but the box lists cardinal, ordinal, and other types. How about creating one box for all number types and labeling it Hungarian numbers, this way the same {numberbox} template could be used for all types of numbers without change.
  2. Can the text be vertically alined in the middle row? (e.g. három, harmadik, hármas - the first letters would be on the same vertical line).
  3. I believe hármas is not a multiplier, (that might be háromszor - three times), it does not have an English equivalent.
  4. Are you planning to add all forms? For example, harmad (third). Hungarian numbers can also get case endings. The list can get really long.
  5. Is there a way to simplify the template parameters and make the order more intuitive? For example, do we need to provide both the full language and lang=hu? Is it possible to figure out which language from the two-letter code? Why are kettő and négy provided as parameters if they are not used?

Example parameters:

{numberbox|2=kettő|3=három|4=négy|ord=harmadik|mult=háromszor|figure=hármas|lang=hu|wplink=3 (szám)}

Can we experiment with small changes and see how it looks? --Panda10 23:18, 28 June 2008 (UTC)Reply

Thanks for the suggestions. A few replies:
  1. I thought about having one box for all sorts of numbers, but decided against it. Consider that the symbolic form of an ordinal number is usually different from the cardinal form: 1 vs 1st. So, the same box couldn't simply be copied and pasted to diffeent entries with the same argument values. The ideal is also that the template allows you to link to a given appendix or page explaining the grammar of these numbers. So you could link "Hungarian cardinal numbers" to Appendix:Hungarian cardinal numbers, if that page existed. If the title is generic, then the choice of title has to be added as yet another argument. It just seems eaiser to use a separate template for each kind of number.
  2. I also thought about horizontal alignment, but it would require putting the label and link in separate table boxes, which would add an ugly line down the middle of the box.
  3. Re multipliers: OK.
  4. I'm intending for this to only be used on the lemma page of cardinal numbers.
  5. But kettő and négy are used. They are the link targets. The symbol is displayed (to keep the box narrow), but the link is made to the word's entry. Your suggested version leaves off the symbolic forms. You can't say "2= kettő" because that tells the template that argument number 2 has a value of "kettő". It doesn't tell the template that a numerical vaue of two means the same as the word "kettő". The template still needs each items, and has to have items in the same location each time to interpret them correctly. There should be a way to get both the language name and language code from just entering the code, but I don't know how to code that.
--EncycloPetey 23:35, 28 June 2008 (UTC)Reply
Per your suggestion, I have figured out how to eliminate the need to specify the full language name. That is now handled by including the ISO code as the first parameter. --EncycloPetey 05:18, 29 June 2008 (UTC)Reply
{{language}} gets the name from the code (and is preferable to tsect, which is an optimization just for {t}). {{langname}} will accept either code or name, and return the name. FYI: I tweaked the CSS class and margins to make it play nicely with others (;-) Robert Ullmann 16:37, 30 June 2008 (UTC)Reply
Thanks for noting that. I wasn't sure which template was current for doing that, and have now made the change to {{language}}. --EncycloPetey 17:28, 30 June 2008 (UTC)Reply

Transliterations edit

I like how ordalt, advalt, etc. pair with their base parameters. Should this template also allow allow transliterations for terms of non-Latin script, e.g. with "ordtr", "advtr", etc.? Rod (A. Smith) 16:17, 30 June 2008 (UTC)Reply

I had considered that a really did try making it work. However, I found that would get messy, and would probably require a complete restructure of the way the template adds additional (optional) lines of text. The coding problem is that it's done as a wikitable rather than with <div to keep it compact.
The main body of the display box is all one cell. When an additional parameter is detected, you get a line break and the additional row of text is added in the same cell. This means that for longer words, if a transcription were included that requires the text top wrap, it would wrap all the way to the left edge of the box and would look terrible. This isn't a simple problem to fix because you can't generate an optional row of cells inside an #if: (or if you can, then I haven't seen how it's done). This is also why the colons separating the labels from the words aren't lined up—they're not in separate cells, so the label and text can't be independently aligned. I tried an alternative version called {{cardinalbox2}} that called {{cardinalboxline}} to generate the optional lines, and if I knew how to use <div better, then it might have worked. (Yes, I deleted both, but sysops can resurrect them and play with them if they like).
To summarize, I think it would be nice to have transcriptions included optionally, but it would really need a coding redesign to make that feasible. --EncycloPetey 17:10, 30 June 2008 (UTC)Reply
I understand. Transliterations aren't crucial anyway, since the box is supposed to be compact and readers can just click through the links for more info. Rod (A. Smith) 17:29, 30 June 2008 (UTC)Reply
Hmm... While hunting for some unrelated linking syntax, I stumbled across a page that purports to explain how to code conditional table rows. If the information is true, then I can code this after all. I may try sometime in the next couple of days. --EncycloPetey 04:23, 1 July 2008 (UTC)Reply
You can do it two ways: one is to mix in some HTML syntax (see {{ja-kanjitab}}), e.g. </td></tr><tr><td> will take you from the last cell of one row to the first cell of a new row. But in this case, a subtemplate would be cleaner and easier: create {{cardinalbox/row}} and have it generate a new row. E.g. if you want 3 columns, it would contain:
|-
| {{{1|}}} || {{{2|}}} || {{{3|}}}

then wrap the desired conditional around the invocation(s) of cardinalbox/row with the column contents for each as 3 parameters. Robert Ullmann 13:15, 2 July 2008 (UTC)Reply

You can also use {{!}} as the subtemplate just for |, like this:

{{#if:(whatever)|
{{!}}-
{{!}} col 1 {{!}}{{!}} col 2 {{!}}{{!}} col 3
}}

and just do it inline. (now you know what {{!}} is for ;-) Robert Ullmann 13:32, 2 July 2008 (UTC)Reply

Yes, I know about {{!}} and tried using it. It didn't work in combination with the hyphen to create a line break. If it had, transcription capability would already be part of the template. As I said, I found a page purporting to explain how to do this properly, and it may explain what went wrong in my attempt. I may have a chance to play with that this afternoon or Friday. --EncycloPetey 16:20, 2 July 2008 (UTC)Reply
Works fine for me (see User:Robert Ullmann/x, this revision if someone is looking in the future). Maybe you made some other mistake? Robert Ullmann 16:35, 2 July 2008 (UTC)Reply
Quite possibly. I won't know until I have a nice long period of uninterrupted time to look seriously at the code. --EncycloPetey 17:10, 2 July 2008 (UTC)Reply

Multiple ordinals edit

Would it be feasible to add a way to indicate multiple ordinal lemmas? Catalan has two lemmas for 5th-8th, 10th, 100th, and 1000th, with one being a from derived from Latin while the other is the cardinal + . While those Latinate forms for 5th-8th are less commonly used, those for 10th, 100th, and 1000th are more commonly used yet the abbreviations for the masculine ordinals derive from the "standard" ordinal form, so I'd prefer to link both from the box for the powers of 10 at least. (I'm not even worrying about Valencian forms where "huit" is used for eight instead of "vuit". Those I'll just handle with the xs parameter and a second box where needed.) Carolina wren 01:04, 1 March 2009 (UTC)Reply

Giving it some thought, if additional options are added, it would seem to that parameters like ordhand that would allow one to hand code what follows Ordinal or the other entries in the white box might be of value for not just my case, ordhand={{l|ca|mil·lèsim}} or {{l|ca|milè}}, but others as well. It wouldn't be too onerous to use for those who could make use of it, and the coding (as opposed to perhaps the code execution) would be too bad either. Carolina wren 03:22, 1 March 2009 (UTC)Reply
It sounds more like there are alternate forms from what you describe, rather than multiple lemmata. Could you describe explicitly the situation for the two "lemmata" for 5th, so I can better understand what you mean? This is the first time I've heard of such a thing; usually it's just masculine/feminine forms that I've seen in Romance languages. --EncycloPetey 06:10, 1 March 2009 (UTC)Reply
Fifth can be formed adding the suffix to cinc (five) form the lemma cinquè m sg and its derived forms cinquena f sg, cinquens m pl, and cincquenes f pl, but Catalan also a Latinate lemma for fifth, quint sg, with derived forms quinta f sg, quints m pl, and quintes f pl}, that is derived directly from the Latin quintus (fifth). Sixth is either sisè or sext, seventh is either setè or sèptim, and eighth is either vuitè or octau. Carolina wren 18:19, 1 March 2009 (UTC)Reply

Bug edit

If you look at this, when there is a space after the language code and before the pipe, it produces {{ta /script}} instead of {{ta/script}} (when the lang is ta, obviously). Mglovesfun (talk) 10:19, 15 June 2012 (UTC)Reply

I haven't tested it, and I'm not that knowledgeable, but I bet if you put |xs=ta it would solve the problem. --Μετάknowledgediscuss/deeds 16:26, 15 June 2012 (UTC)Reply
This was a limitation of {{lx}}, which CodeCat (talkcontribs) recently changed this template to use. I've now resolved the issue by modifying {{lx}} to strip any leading and/or trailing whitespace from its first parameter. —RuakhTALK 23:11, 15 June 2012 (UTC)Reply

Fractionals? edit

How about adding an extra parameter for fractional numerals? In Latvian, these are different from ordinals (third, fourth = trešais, ceturtais; one third, one fourth = trešdaļa, ceturtdaļa, with daļa, "part"). I'm already using the opt= parameter for Nominal forms; I couldn't use it again for fractionals, I think. --Pereru (talk) 13:46, 18 August 2012 (UTC)Reply

Ah, I never forsaw this. I added opt= for Rapa Nui numbers, but I wasn't thinking about other languages. Would you be fine with just another set of optional parameters to be added? (And do you have any preference on what they should be named?) --Μετάknowledgediscuss/deeds 14:58, 18 August 2012 (UTC)Reply
Sure, something like "opt2", "opt2x", "opt2alt" would take care of the problem. (I don't think fractional numerals are frequently found, even in European languages, though my native Portuguese does have a few terms that are exclusive to fractions: terço "one third", an older variant of terceiro "third", and the word avos used with denominators higher than 10: 1/11 is "um onze avos" (the ordinal "décimo primeiro" cannot be used here). --Pereru (talk) 05:01, 19 August 2012 (UTC)Reply
Will do. If you care about adding the new params and a Latvian example to the doc subpage, please do. --Μετάknowledgediscuss/deeds 05:04, 19 August 2012 (UTC)Reply
  Done. But opt2xalt= is a pretty long parameter name... --Μετάknowledgediscuss/deeds 05:07, 19 August 2012 (UTC)Reply
  Done (for the extra example and the added paremeters in the documentation page). Yeah... there should be a contest for the worst parameter names... hopefully we won't need to use it very often. --Pereru (talk) 23:23, 19 August 2012 (UTC)Reply

Transliteration edit

In Greek numbers δύο, τρία the signs "<" (for previous) and ">" (for next) are also transliterated which (I think) is meaningless. --Xoristzatziki (talk) 05:43, 26 August 2013 (UTC)Reply

(1) perhaps for "Transliteration " read "Link" (there's no transliteration)
(2) Surely it should be possible to leave zero "<" ">" values without throwing an error?   — Saltmarshσυζήτηση-talk 05:07, 7 September 2015 (UTC)Reply
Return to "cardinalbox" page.