[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: Plural Handling
From:       Stephan Kulow <coolo () kde ! org>
Date:       2003-05-13 6:33:31
[Download RAW message or body]

On Monday 12 May 2003 14:23, Prof. Dr. Eduard Werner / Edward Wornar wrote:
> Hello,
> 
> I guess there are a few errors in the description of plural handling:
> 
> Four forms, special case for one and all numbers ending in 2, 3, or 4
>      The header entry would look like this:
>  
>           Plural-Forms: nplurals=4; \
>                         plural=n==1 ? 0 : \
>                                n%10==2 ? 1 : n%10==3 || n%10==4 ? 2 : 3;
>  
>      Languages with this property include:
>  
>     Slavic family
>           Slovenian
> 
> The above rule would result in numbers like 12, 22 taking the dual
> and numbers like 13, 24 taking the nom pl which is wrong. On
> the other hand, 101 would take the genetive pl, which is wrong either.
> So I guess this should read
> 
> Plural-Forms: nplurals=4; \
>         plural=n%100==1 ? 0 : \
>                   n%100==2 ? 1 : n%100==3 || n%100 == 4 ? 2 : 3;
> 
> Languages with this property include:
> 
> Slavic family
> 	Slovenian
> 	Upper Sorbian
> 	Lower Sorbian 
> 
I don't know where you got your info from, but the code KDE uses is the 
one for the correct form:

  case 6: // Slovenian
    EXPECT_LENGTH( 4 );
    if ( n%100 == 1 )
      return put_n_in( forms[1], n); // ena datoteka
    else if ( n%100 == 2 )
      return put_n_in( forms[2], n); // dve datoteki
    else if ( n%100 == 3 || n%100 == 4 )
      return put_n_in( forms[3], n); // tri datoteke
    else
      return put_n_in( forms[0], n); // sto datotek

Greetings, Stephan
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic