Log in

No account? Create an account

Previous Entry Share Next Entry
Looking for a word
jducoeur wrote in querki_project
I really do owe this journal an update on all the stuff that's being added -- as expected, getting the wedding invites out the door (which is slowly starting, but only a few so far) is forcing me to add lots of new features. It's hectic but exciting, as we move from "Insufficient" to "Sufficient to do something real". (Following which we will progress to "Adequate to daily use" and, with any luck, "Good" in a few months.)

Here's one looking for a quick opinion, since I just discovered that I need to add it today. I need to add a function that returns the correct word -- singular or plural -- depending on how many things are in the received list. This is a pretty common problem, but to give the immediate example, say that an Invitee has an optional list of Children. I need to write something like:
Your [[Children -> __thingy("Child is", "Children are")]] ...
What is the right name for function _thingy(), which chooses the first parameter if the field is singular, the second if it is plural? (Note that parameters can be anything; I just suspect that text will be the most common usage.)

Obviously, I can do something horribly obvious like _singularOrPlural() if need be. But I have a feeling that there's a correct word out there, so suggestions would be welcomed...

  • 1
The thing is, the way Querki works, you're most often not even going to be displaying that *section* if the list is empty.

Hmm. In situations where I've dealt with singular/plural in the past, 0 has usually come up, due to a combination of two factors:
1. Dense layout. There's no "section" for [whatever]; it's a short snippet of text in a longer description / sentence.
2. Knowledge is not presumed absolute, so "0 of [whatever]" is more knowledge/data than no sentence at all (implying no knowledge).

That being said, you've obviously gone through use cases for Querki in far more detail than I have. :)

True, but I think you've made a good point here. There's little overhead in implementing things so that the plural form is used in the 0 case, so I may as well try that out, and we can see how it works...

  • 1