gnuherds-app-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pkg-isocodes-devel] merging, using, trying to use ...


From: Davi Leal
Subject: Re: [Pkg-isocodes-devel] merging, using, trying to use ...
Date: Sun, 25 Mar 2007 13:38:24 +0100
User-agent: KMail/1.9.5

Alastair McKinstry wrote:
> Different languages have different plural forms based on the number of
> objects (and type), ie. you cannot safely use:
>
> printf("%d %s", num, _("dinars");
>
> English has simple rules with "singular == dinar, plural = dinars",
> with other languages it can vary with context and number, eg.
> the form in Irish varies with n < 7 and n > 7.

I know.  About context you can read as an example:

  10.2.6 How to use gettext in GUI programs
  http://www.gnu.org/software/gettext/manual/html_mono/gettext.html#SEC151

> There is code to handle this; see the gettext info pages,
> but plural forms are best avoided altogether

I have not read that "plural forms are best avoided" at the gettext manual!!!. 
Could you point me to such paragraph?.

> and the interface defined accordingly.

Yes, I have read: "Instead the extended gettext interface should be used."


I am just Copy&Pasting form this URL. I am not a gettext expert, I am just 
learing to use it:

  10.2.5 Additional functions for plural forms
  http://www.gnu.org/software/gettext/manual/html_mono/gettext.html#SEC150


  "... the GNU project require program being written in English, this
   solution nevertheless fulfills its purpose."

  "Now, how do these functions solve the problem of the plural forms?
   Without the input of linguists (which was not available) it was
   not possible to determine whether there are only a few different
   forms in which plural forms are formed or whether the number can
   increase with every new supported language."

  "Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;"

  "The nplurals value must be a decimal number which specifies
   how many different plural forms exist for this language."



 Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;

 char * ngettext (const char *msgid1, const char *msgid2, unsigned long int n)

 printf (ngettext ("%d file removed", "%d files removed", n), n);



For example, for Polish:

  Plural-Forms: nplurals=3; \
    plural=n==1 ? 0 : \
      n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;

      1 plik
      2,3,4 pliki
      5-21 pliko'w
      22-24 pliki
      25-31 pliko'w


Alastair, what I do not know is how the POT file template should be for 
languages with 'nplurals' greater than 2, as Polish.

For languages with 'nplurals' equal to 2, as Spanish, I think two forms should 
be defined at the POT files, the singular one an the plural one:

  msgid "Dinar, Libya"            English singular
  msgstr "Dinar, Libia"           Spanish singular

  msgid "Dinars, Libya"           English plural
  msgstr "Dinares, Libia"         Spanish plural


  Plural-Forms: nplurals=2; plural=n != 1;

      0 Dinares
      1 Dinar
      2 Dinares
      3 Dinares
      4 Dinares
      5 Dinares
      n ...


P.S.: Maybe I have done some mistake on the files which I sent to the 
iso-codes email list.

P.S.: We will follow working with the iso-codes email list, due to we want be 
able to use, at the end of the way, your SVN HEAD version of the PO files.

Best regards,
Davi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]