[wp-polyglots] Problem with plural form

Xavier Borderie xavier at borderie.net
Mon Sep 15 09:42:15 GMT 2008


BTW, this subject makes for an interesting reading:
http://www.gnu.org/software/libtool/manual/libc/Advanced-gettext-functions.html
Section "The problem of plural forms"
:)

-xb.

2008/9/14 Nikolay Bachiyski <nb at nikolay.bg>:
> On Sun, Sep 14, 2008 at 7:34 PM,  <avazbek at gmail.com> wrote:
>> Hi,
>>
>> I'm getting such error:
>> Broken catalog file: singular form msgstr used together with msgid_plural
>>
>> The problem is that Uzbek language has a plural form (lar) but it's
>> not used in such way as it is used in WordPress.
>>
>> Thus, both %s post and %s posts use singular form. If in english you
>> say 1 post, 2 posts and etc. we say 1 post, 2 post and etc. That's why
>> I didn't enter plural form for the WP project in poEdit, and when I
>> translate such strings which have plural forms poEdit giving the error
>> described above and I can't even reopen the saved file.
>>
>> Right now I'm leaving such strings and decided to translate them in a
>> text editor one by one but I wonder if there's any better solution for
>> this problem. Any help would be appreciated.
>
> In order to be able to open the file with poEdit, open it with a
> normal text editor and search for msgid_plural.
> A sample entry should look like:
>
> msgid "%s comment approved"
> msgid_plural "%s comments approved"
> msgstr[0] "singular translation"
> msgstr[1] ""
>
> If yours look like:
>
> msgid "%s comment approved"
> msgid_plural "%s comments approved"
> msgstr "singular translation"
>
> just repace this occurence of msgstr with msgstr[0].
>
> After fixing the catalog, go to the catalog settings in poEdit and enter:
>
> nplurals=1; plural=0;
>
> in the Plural forms field.
>
> After that poEdit will only ask you for one plural form and not for two.
>
> If you have more problems, send us the PO file.
>
> Happy translating,
> Nikolay.
> _______________________________________________
> wp-polyglots mailing list
> wp-polyglots at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-polyglots
>



-- 
Xavier Borderie


More information about the wp-polyglots mailing list