FluxBB Forums
Unfortunately no one can be told what FluxBB is - you have to see it for yourself.
You are not logged in.
#1 2008-08-01 22:56:39
- vincent
- Member
- Registered: 2008-07-31
- Posts: 9
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 22:58:40)
Offline
#2 2008-08-01 23:13:07
- Smartys
- Former developer
- Registered: 2008-04-27
- Posts: 2,880
- Website
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).
Offline
#3 2008-08-01 23:37:35
- vincent
- Member
- Registered: 2008-07-31
- Posts: 9
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 23:39:26)
Offline
#4 2008-08-01 23:47:07
- Smartys
- Former developer
- Registered: 2008-04-27
- Posts: 2,880
- Website
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.
Offline
#5 2008-08-01 23:51:50
- vincent
- Member
- Registered: 2008-07-31
- Posts: 9
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)
Offline
#6 2008-08-01 23:53:33
- Smartys
- Former developer
- Registered: 2008-04-27
- Posts: 2,880
- Website
Re: Guests online text + little improvement on user count
Yes, that's exactly what I said.
Offline
#7 2008-08-02 00:17:14
- vincent
- Member
- Registered: 2008-07-31
- Posts: 9
Re: Guests online text + little improvement on user count
hm, so we said the same thing
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é"
Offline
#8 2008-08-02 01:52:16
- damaxxed
- Member

- From: Germany
- Registered: 2008-05-16
- Posts: 353
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):
0 Guests
1 Guest
% Guests
Offline
#9 2008-08-02 02:02:37
- Pandark
- Member

- From: France
- Registered: 2008-05-17
- Posts: 18
- Website
Re: Guests online text + little improvement on user count
Yes.
Which in French does:
0 invité (or aucun invité)
1 invité
% invités
Last edited by Pandark (2008-08-02 02:05:16)
.._ -Pandark- _..
Serial Dreamer
Offline
#10 2008-08-02 03:33:36
- artoodetoo
- Member

- From: Far-Far-Away
- Registered: 2008-05-11
- Posts: 156
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
![]()
Offline
#11 2008-08-02 03:39:48
- artoodetoo
- Member

- From: Far-Far-Away
- Registered: 2008-05-11
- Posts: 156
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.
Offline
#12 2008-08-02 04:30:44
- Paul
- Site Admin
- From: Wales, UK
- Registered: 2008-04-27
- Posts: 1,600
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.
Offline
#13 2008-08-02 09:40:56
- vincent
- Member
- Registered: 2008-07-31
- Posts: 9
Re: Guests online text + little improvement on user count
yeah ! merci ![]()
Offline
