Topic: Guests online text + little improvement on user count

Hello,

In lang/index.php we have 'Users plural', 'User single' and 'Users none' that's great, but we should also have a 'Guest none'.

Because I think "There are 0 guests and.." shoud be  "There are 0 guest and..." or "There are no guest and..."

Perhaps by replacing this :

<?php (($num_guests != 1) ? printf($lang_index['Guests plural'], forum_number_format($num_guests)) : printf($lang_index['Guest single'], $num_guests)) ?>

by something like this :

<?php 
    if ($num_guests < 1)
        printf($lang_index['Guest none'], $num_guests);
    elseif ($num_guests == 1)
        printf($lang_index['Guest single'], $num_guests);
    else
        printf($lang_index['Guests plural'], forum_number_format($num_guests));
    ?>

By the way, I think this piece of code :

<?php ((count($users) > 1) ? printf($lang_index['Users plural'], forum_number_format(count($users))) : printf(((count($users) == 0) ? $lang_index['Users none'] : $lang_index['User single']), count($users))) ?>

Should be replace by a similare piece than the one for pluralize the guest count. A variable could be added just before 'in_users_online_pre_online_info_output' hook.

$num_users = count($users);

[...]

<?php 
    if ($num_users < 1)
        printf($lang_index['Users none'], $num_users);
    elseif ($num_users == 1)
        printf($lang_index['User single'], $num_users);
    else
        printf($lang_index['Users plural'], forum_number_format($num_users));
    ?>

So like this we could have just one count($users) and the possibilty to use this number in previous hook, plus the possibility to use textual for "none" and "one" like "... and one registered user online"

Last edited by vincent (2008-08-01 21:58:40)

Re: Guests online text + little improvement on user count

Moved to Feature requests, since this isn't a bug.
You are grammatically incorrect: you don't use a plural verb (are) and a singular object (guest).

Re: Guests online text + little improvement on user count

yes your right ! I'm not speak English very well and I just past the text from the forum, so I think it is not a feature request but a bug

because 0 (zero) isn't plural ; isn't it ?

Ce qui est sûr c'est qu'en français "Il y a 0 invités" c'est grammaticalement une erreur également.

Last edited by vincent (2008-08-01 22:39:26)

Re: Guests online text + little improvement on user count

Zero is plural in many languages
http://en.wikipedia.org/wiki/Plural

Languages having only a singular and plural form may still differ in their treatment of zero. For example, in English, German, Dutch, Italian, Spanish and Portuguese, the plural form is used for zero or more than one, and the singular for one thing only. By contrast, in French, the singular form is used for zero.

Re: Guests online text + little improvement on user count

no, in french we write "Il y a 0 invité" et "Il y a 2 invités" but we prefere wrinting "Il n'y a aucun invité" (for zero guest)

Re: Guests online text + little improvement on user count

Yes, that's exactly what I said.

Re: Guests online text + little improvement on user count

hm, so we said the same thing smile but I'm not sure.

Two forms could claim our needs in french (singular/plural) :

singular :

in french :
  - "Il y a 0 invité"
  - "Il y a 1 invité"

in English :
  - "There is 0 guest"
  - "There is 1 guest"

plural : 

in french :
  - "Il y a X invités"

in English :
  - "There are X guests"


But actually forums display :

singular :
  - "There is 1 guest"

plural : 
  - "There are 0 guests"
  - "There are X guests"

In french 0 IS singular NOT plural. So we have a problem.

So for more flexibility and because wikipedia say some languages use pural for zero and other use singular (like in french) I suggest 3 forms :
none/singular/plural

0 = "Il n'y a aucun invité" or "Il y a 0 invité" / "There is no guest" or "There are 0 guests"
1 = "Il y a un invité" or "Il y a 1 invité" / "There is one guest" or "There is 1 guest"
X = "Il y a X invités" / "There are X invité"

Re: Guests online text + little improvement on user count

That's the best solution for i18n: 3 Strings (as reference: Wordpress does it exactly like that):

  1. 0 Guests

  2. 1 Guest

  3. % Guests

FluxBB, the PunBB of tomorrow - today!

Re: Guests online text + little improvement on user count

Yes.
Which in French does:

  1. 0 invité (or aucun invité)

  2. 1 invité

  3. % invités

Last edited by Pandark (2008-08-02 01:05:16)

.._ -Pandark- _..
Serial Dreamer

Re: Guests online text + little improvement on user count

just for example in Russian (latin transliteration):

0 gostej or net gostej (plural #1)
1 gost' (single)
2 gostia (plural #2)
3 gostia
4 gostia
5 gostej (plural #1)
...
21 gost' (is it plural or single?)
22 gostia
... etc. last digit is rule

smile

Re: Guests online text + little improvement on user count

Some of webmasters puts function definitions to language files to solve language specific number|gender variations. Probably, it is unique solution.

Re: Guests online text + little improvement on user count

I've tinkered with this as much as I'm going to. It should now be ok for most langauges and is more extensible.

The only thing worse than finding a bug is knowing I created it in the first place.

Re: Guests online text + little improvement on user count

yeah ! merci smile