On Yaum al-Jumma 05 Jumaada al-Thaani 1425 05:56 pm, Abdulaziz Al-Arfaj wrote:

> > How can just inserting a header in a text file change the file?! Do I
> > need to
> > insert this header in each .po?! I thought this header should be
> > somewhere
> > built into the sources (.cpp or .h files) of KDE, GNOME, debian
> > installer, ... not in the .po files themselves, no?
>
> Its magic ;)
> Seriously, every language needs a specific header for it to handle the
> plurals. You don't need to insert this header into every file. Just in
> the files that have plural forms. It makes no sense to put these
> headers in the source files, because you would have to insert one
> header for EVERY language. Better to put it in a .po so it could be
> language specific.

What?!  Is it better to insert one header for each language once and forever 
or to have every translator to put a header each time in all .po that 
contains plurals for each language with every new file until he dies ;) 
Anyway, I checked the sources and found what I am looking for:

klocale.cpp:

  case 11: // Arabic
    EXPECT_LENGTH( 4 );
    if (n == 1)
      return put_n_in(forms[0], n);
    else if (n == 2)
      return put_n_in(forms[1], n);
    else if ( n < 11)
      return put_n_in(forms[2], n);
    else
      return put_n_in(forms[3], n);

So keep in mind any changes we suggest should be reflected here. This would 
break the existing plural translation so we need to solve this once and for 
ever.

> ==============================================
> My proposal: six plural forms!
>
> nplurals = 6; plural = n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100==1 ||
> n%100 ? 3 : n%100>2 && n%100<=10 ? 4 : 5
>
> Lets imagine we were talking about cats. Here is what you would put in
> the translation file under each tab in kbabel:
>
> [0]: Ù ÙØ ÙØØ
Keep in mind the context here. I have killed %n cats during my life would 
yield a wrong translation with n=0 per you suggestion.
ØÙØ ÙØÙØ ÙÙØ ÙØØ ÙÙ ØÙØØÙØ! ØØØØØ ØÙÙØ ØÙÙÙØ ÙØØ 
ÙØ ÙØØØØ ÙØØÙÙØ ØÙØØØØØ ØØØ 
ØÙØÙØÙ. ØØØÙ ØØØØÙ ØÙØØ ÙÙ ÙØÙØ ÙÙØ ÙØÙØ! ÙÙ 
ÙØØØØ ØÙ ØØÙØÙ ÙØØÙØ ØÙØÙØ. ÙØÙØ 
ÙÙ ÙÙÙÙ ØÙ ÙØØÙ ÙØØØØÙØ ÙÙÙÙÙ ØÙØØ ØÙØ ÙÙÙ 
ÙØØØØ ÙÙ ØØØÙØ ØØØØÙ ÙÙ ØÙØ ÙØØÙÙØ 
ÙÙ ØÙÙ ØØÙØ ØØÙ ØÙØ ÙÙÙØÙ ØÙÙ ØÙØ ØÙÙØØÙÙØØØ :)


> [1]: ÙØØ ÙØØØØ
> [2]: ÙØØØÙ
> [3]: %n ÙÙ ØÙÙØØ
> [4]: %n ÙØØ
> [5]: %n ÙØØ

you mean by "n%100 ? 3" to say "n%100==2 ? 3"?
I can't understand how you made a dfference between 101 and 105. Do you want 
to say
101 ÙÙ ØÙÙØØ ÙØÙÙ 102 ÙÙ ØÙÙØØ ÙÙÙÙ ØÙØ ØÙ ØÙÙÙ 103 
ÙØØØ
I believe it's not correct like this. But you have given me a good idea.

To solve this problem without lots of complications I would suggest:

for n>=2 to say 
ÙÙ ÙØØ ÙØÙØÙ
2 ÙÙ ØÙÙØØ
3 ÙÙ ØÙÙØØ
4 ÙÙ ØÙÙØØ
101 ÙÙ ØÙÙØØ
150 ÙÙ ØÙÙØØ

What do you think?

-- 
Munzir Taha  PGP Key available
gpg --recv-keys --keyserver www.mandrakesecure.net F0671821

Telecommunications and Electronics Engineer
Linux Registered User #279362 at http://counter.li.org
Mandrake Club member
Maintainer of the Open Arabic Bugs Project at
http://wiki.arabeyes.org/OpenBugs
CIW Designer, ICDL, MOUS
New Horizons CLC
Riyadh, SA
_______________________________________________
Doc mailing list
[EMAIL PROTECTED]
http://lists.arabeyes.org/mailman/listinfo/doc

رد على