[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Plurals in translations was Re: [STRAW POLL] Help on i18n translations?

From: Nicolás Lichtmaier <nick_at_reloco.com.ar>
Date: 2004-04-01 20:17:52 CEST

Justin Erenkrantz wrote:

> --On Thursday, April 1, 2004 12:21 PM -0300 Nicolás Lichtmaier
> <nick@reloco.com.ar> wrote:
>
>> I'm also adding _() everywhere.
>
>
> Cool. Once we know we haven't killed the build everywhere (probably
> straightened out by now), we can start checking in the _() changes as
> well.

The changes are harmless anyway. Have you read my comment about #include
<config.h> needing to be *before* the other includes?

>> BTW.. how do we handle plurals? GNU gettext
>> has a way, but it seems that we don't want to depend on that =).
>
>
> How does it do it? -- justin

Normal gettext is:

char *gettext(char *);

There's a ngettext function, defined as:

char *ngettext(char *msgid1, char *msgid2, int n);

where msgid1 is the English singular form, msgid2 the English plural
form and n is the quantity. E.g.:

sprintf(ngettext("%d file updated", "%d files updated", n), n);

xgettext will properly parse and handle this. It has extended the .po
format to do that.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Apr 1 20:21:20 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.