Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2002:
[Freeciv-Dev] Re: Plural forms support
Home

[Freeciv-Dev] Re: Plural forms support

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Plural forms support
From: "mateusz stefek" <matusik_s@xxxxx>
Date: Sat, 05 Jan 2002 06:18:33 +0100

>On Thu, Dec 27, 2001 at 03:55:19PM +0100, mateusz stefek wrote:
>> Hi,
>>
>> I wrote a patch which helps handling plural forms in translations.
>>
>> The attached patch is only declaration of macro:
>>
>> #define PL_(String1,String2,n) ngettext(String1,String2,n)
>>
>> Wchich should be used like:
>>
>> PL_("change in: %d turn", "change in: %d turns", count_change_turns)
>>     ^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^
>>     untranslated singular  untranslated plural    counter
>>
>> when making freeciv.pot xgettext uses argument: --keyword=PL_
>> Only singular form from PL_ is put into freeciv.pot and it's ok.
>>
>> You have to run autoconf and ./configure before compiling new code.
>>
>> The macro PL_() is currently never used.
>> If you think PL_() system is good I'll go through the source and replace
>every:
>> n > 1 ? _("plural") : _("singular")
>> with
>> PL_("plural", "singular", n)
>
>I never have though about this before. Sound ok. About how many
>possible instance of PL_ are we speaking about? And why is only the
>singular form put into the pot file?
>
>       Raimar
In English-compatible languages:

1 turn
2 turns
3 turns
...

In my language and many slavonic languages it is something like that:

1 tura
2 tury
3 tury
4 tury
5 tur
6 tur
...
21 tur
22 tury
23 tury
24 tury
25 tur

To select correct plural form we should use ngettext function.
Entry in .po file should look like:

msgid "%d turn"
msgid_plural "%d turns"
msgstr[0] "%d tura"
msgstr[1] "%d tury"
msgstr[2] "%d tur"

Do you agree?

---
mateusz




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