Use of singular/plural forms

Lapinoo
Lapinoo's picture

Joined: 2004-05-08
Posts: 378
Posted: Mon, 2006-02-20 12:16

I have a nasty problem with the use of singular and plural forms.

As far as I know, 1 is singular, 2 and more is plural, but 0 is either singular or plural depending on the language.

For example, it is in english: "You have 0 elements in your caddy", which is displayed as "vous avez 0 éléments dans votre panier" in french instead of the correct form "vous avez 0 élément dans votre panier".
I french, when elements are counted, if there are none, then there is no use for the plural form.

Is this problem specific to french? (ie. is 0 followed by the plural form in german, spanish, italian...)

Could we have "0", "1", "2+" strings is the .po files (I don't know if gettext supports this)?

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Mon, 2006-02-20 12:55

Hello,

the plural forms can be very different.

For some reason the plural form definitions for french are different in G1 and G2. (i only develop G1)
G1:
if count is 0, or 1 then the singular form is used
if > 1 then the plural is used.

G2:
if count is 1 then the singular form is used
if != 1 then the plural is used.

It sounds like you are using G2, as G1 has no "caddy".

It seems to me that G2 is using the wrong definition.
As its the same like for english, or german.
But when i made the plural form for french in G1, i saw that its not the same. Thats why g1 uses a different definition.
Can you verify this ? Or are really 3 forms needed ?

Jens
--
Last Gallery v1 developer and translation manager.

 
Lapinoo
Lapinoo's picture

Joined: 2004-05-08
Posts: 378
Posted: Mon, 2006-02-20 13:47

Yes, I forgot to mention that the problem is specific to G2. Well, in fact, I never used G1 in french (shame on me...).

I'll check the "official" grammar rules tonight.

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Mon, 2006-02-20 14:13

Well,

its simple :)

In g1 it would be:

"vous avez 0 élément dans votre panier"
and
"vous avez 1 élément dans votre panier"

is that correct or wrong ?

Jens
--
Last Gallery v1 developer and translation manager.

 
Lapinoo
Lapinoo's picture

Joined: 2004-05-08
Posts: 378
Posted: Mon, 2006-02-20 14:25

Yes, this is correct.

I just would like to be sure that in french it is 0 + singular... I still have a very small doubt...

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2006-02-20 17:28

Lapinoo, you need to update the "nplurals" line in the po files for french.. sounds like n > 1 is the expression you want.

 
Lapinoo
Lapinoo's picture

Joined: 2004-05-08
Posts: 378
Posted: Mon, 2006-02-20 20:49

Thanks mindless,

it worked!

I now have to update the 60+ fr.po files :)