[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: initial .po file with correct plural forms
From: |
Bruno Haible |
Subject: |
Re: initial .po file with correct plural forms |
Date: |
Fri, 10 Sep 2004 22:47:17 +0200 |
User-agent: |
KMail/1.5 |
Hello,
Jens A. Tkotz wrote:
> We use gettext and ngettext within php to show translated pages.
Interesting: the use of PHP with gettext seems to be growing.
> With this line we create the initial messages.po file:
>
> xgettext --files-from=filelist-core -LPHP --keyword=_ --no-wrap
>
> In the header we get:
> "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
>
> And at places where we use ngettext we get for example:
> #, php-format
> msgid "one page"
> msgid_plural "%d pages"
> msgstr[0] ""
> msgstr[1] ""
>
> Problem:
>
> We have languages with different plural definitions. Like turkish or
> russian. So we would only need msgstr[0] or additional msgstr[3] and
> msgstr[4] We were not able to modify this automatically and have to
> add/remove those entries manually.
>
> Question:
>
> How can we initially create a .po file with correct plural forms ?
If the number of plural forms is not correct, you can always fix this
using a plain text editor.
I think the support for plural forms in kbabel and gtranslator needs some
more work; likewise for msginit.
> Or how can we modify existing files autmatically according to plural
> definition.
I take this as a wish for 'msginit' and 'msgmerge'. Thanks for the suggestion.
Bruno