[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ordinal numbers
From: |
Bruno Haible |
Subject: |
Re: ordinal numbers |
Date: |
Sun, 29 Aug 2010 11:50:20 +0200 |
User-agent: |
KMail/1.9.9 |
Hi,
Chris Scaife wrote:
> I have been studying internationalization with gettext and am writing
> it up as tutorial which I hope to put on the web somewhere.
>
> I have applied techniques for plurals to ORDINAL enumerations.
> gettext("In the human race you come in %d%s position!\n"),
> i, dngettext("_ordinal", "°","°", i)
Such an approach won't work, because languages are more different than
you think. You are extrapolating from English to other languages and
forgetting the rule "Entire sentences" from
<http://www.gnu.org/software/gettext/manual/html_node/Preparing-Strings.html>
The word "position" has a gender in many languages, and you cannot expext
gender-dependent flexions to follow simple string concatenation rules. It
does not work this way for Ukrainian, in particular.
The best known workaround is to write things like this:
switch (i) {
case 1: gettext("In the human race you come in first position!\n"); break;
case 2: gettext("In the human race you come in second position!\n"); break;
case 3: gettext("In the human race you come in third position!\n"); break;
default: asprintf (gettext("In the human race you come at position %d!\n"),
i); break;
}
Bruno
- ordinal numbers, Chris Scaife, 2010/08/09
- Re: ordinal numbers,
Bruno Haible <=