2

When a user on a popular website gets a response, they are (rather embarrassingly) told that they have "1 responses" (see illustration).

"1 responses"? Embarrassing

I'm sure it must be easy to determine whether they have one response and strip the 's' from the end of the word.

rene
  • 41,474
  • 78
  • 114
  • 152
johnsyweb
  • 136,902
  • 23
  • 188
  • 247
  • 1
    @Johnsyweb You could always check for the number, if the number is greater than 1 then use plural else use singular. – Searock May 22 '11 at 12:24
  • What is the actual question here? Or are you just trying to report a "bug" with the website? – khabraken May 22 '11 at 12:28
  • @Searock: What about languages like Russian that have special forms for 2 and 3 as well? There is no easy answer in the general case for this problem. The best way to design a UI is actually to avoid this. – Joey May 22 '11 at 12:30
  • 1
    @Johnsyweb In that case may be you won't agree with me. I would just display `responses` to display the previous response(s). – Searock May 22 '11 at 12:30
  • @Joey I was just assuming about English, I never thought about multi culture. In that case I agree with you. – Searock May 22 '11 at 12:33
  • @Searock: I completely agree with you. – johnsyweb May 22 '11 at 12:34
  • 1
    I wish I could +1000 this question. To use a plural word after the number 1 is an amateurish mistake. Even worse is the abomination "1 response(s)". – Bryan Oakley May 22 '11 at 14:27
  • 1
    @Spectre: the actual question is in the title: "How can I make my web application understand the difference between singular and plural" – Bryan Oakley May 22 '11 at 14:29
  • 1
    The easiest thing to do is [find yourself a giant S](http://meta.stackexchange.com/questions/66451/auto-revision-summary-has-wrong-plural-added-1-characters-in-body/66453#66453). Then [let your users know how you feel](http://twitter.com/#!/codinghorror/status/1165936105). – Cody Gray - on strike May 22 '11 at 16:17
  • @Cody Gray: I clearly need to read Meta more. – johnsyweb May 22 '11 at 22:15
  • On C#, check out SmartFormat. :) – Brian MacKay Feb 23 '14 at 01:02

2 Answers2

3

For the English language it's generally no more difficult than:

if number == 1:
    print "1 response"
else:
    print "%s responses" % number

For other spoken languages it can be rather difficult because it's not always a matter of just appending an s. The technique remains the same, though. You have to add code to check the number and display the proper form.

Often I'll use completely different wording for the case of zero ("you have no responses"), 1 ("you have only one response") or 2+ (you have N responses). Obviously, in the specific example you give that doesn't apply.

In the specific example you give, however, one could argue that the implementation is correct. It is the "responses" tab with a marker for the number. It's not an English sentence but rather the name of a tab. So, no matter how many responses there are, it will always be the "responses" tab. That's splitting a fine hair though, and I think if this were my website I would probably change it to "1 response".

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
2

It depends on the language/framework you are using. For example, in Rails there is a pluralize helper, which gives:

pluralize(1, 'response') => "1 response"
pluralize(2, 'response') => "2 responses"
RocketR
  • 3,626
  • 2
  • 25
  • 38
  • There is something similar for PHP: http://kuwamoto.org/2007/12/17/improved-pluralizing-in-php-actionscript-and-ror/ – Jay Sidri May 23 '11 at 07:46