bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gettext] Plural forms


From: Roel Vermeulen
Subject: Re: [bug-gettext] Plural forms
Date: Sat, 17 Dec 2016 15:24:31 +0000

Sorry, but it seems to be a bug in the gettext library I am using, and not part of gettext itself. 

https://bugs.launchpad.net/php-gettext/+bug/1415873?comments=all

Apologies
Roel Vermeulen

On Sat, 17 Dec 2016 at 15:58 Roel Vermeulen <address@hidden> wrote:
I am using php-gettext-memcached, PHP-gettext 1.0 (https://launchpad.net/php-gettext) because the native gettext extension is unavailable on Google Cloud AppEngine.

I get these errors:




On Sat, 17 Dec 2016 at 13:41 Bruno Haible <address@hidden> wrote:
Hi,

> I have a case where the singular and plural form are the same in English,
> but different in other languages.
>
> ngettext("%d correct", "%d correct", n)
>
> The Spanish translation would be
> "%d correcto" (singular)
> "%d correctos" (plural)
> indicating the number of correct answers given.

GNU gettext supports this case.

> But this gives me an error since the singular msgid is exactly the same as
> the plural msgid.

I don't get an error here.

$ cat foo.c
ngettext("%d correct", "%d correct", n);
$ xgettext -o - foo.c
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <address@hidden>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-17 13:37+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <address@hidden>\n"
"Language-Team: LANGUAGE <address@hidden>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=_expression_;\n"

#: foo.c:1
#, c-format
msgid "%d correct"
msgid_plural "%d correct"
msgstr[0] ""
msgstr[1] ""


The important thing here is that you don't have 2 msgids, but 1 msgid with an
associated msgid_plural.

What was the error you got? From which tool? Which version of the tool?

Bruno


reply via email to

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