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 <roel.vermeu...@gmail.com>
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:
>
> PHP Warning: Missing argument 4 for gettext_reader::npgettext(), called in 
> /base/data/home/apps/s~valiant-marker-94108/20161217t154911.397817632732775351/libs/gettext/gettext.inc
> on line 359
> <https://console.cloud.google.com/debug/fromlog?appModule=default&appVersion=20161217t154911&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~valiant-marker-94108%2F20161217t154911.397817632732775351%2Flibs%2Fgettext%2Fgettext.inc&line=359&logInsertId=2016-12-17%7C06%3A51%3A14.228127-08%7C10.106.128.65%7C486666032&logNanos=1481986272745392000&nestedLogIndex=86&project=valiant-marker-94108>
> and defined in 
> /base/data/home/apps/s~valiant-marker-94108/20161217t154911.397817632732775351/libs/gettext/gettext.php
> on line 446
> <https://console.cloud.google.com/debug/fromlog?appModule=default&appVersion=20161217t154911&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~valiant-marker-94108%2F20161217t154911.397817632732775351%2Flibs%2Fgettext%2Fgettext.php&line=446&logInsertId=2016-12-17%7C06%3A51%3A14.228127-08%7C10.106.128.65%7C486666032&logNanos=1481986272745392000&nestedLogIndex=86&project=valiant-marker-94108>
> 15:51:13.717PHP Notice: Undefined variable: number in 
> /base/data/home/apps/s~valiant-marker-94108/20161217t154911.397817632732775351/libs/gettext/gettext.php
> on line 448
> <https://console.cloud.google.com/debug/fromlog?appModule=default&appVersion=20161217t154911&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~valiant-marker-94108%2F20161217t154911.397817632732775351%2Flibs%2Fgettext%2Fgettext.php&line=448&logInsertId=2016-12-17%7C06%3A51%3A14.228127-08%7C10.106.128.65%7C486666032&logNanos=1481986272745392000&nestedLogIndex=87&project=valiant-marker-94108>
> 15:51:13.717PHP Parse error: syntax error, unexpected '!='
> (T_IS_NOT_EQUAL) in
> /base/data/home/apps/s~valiant-marker-94108/20161217t154911.397817632732775351/libs/gettext/gettext.php(387
> <https://console.cloud.google.com/debug/fromlog?appModule=default&appVersion=20161217t154911&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~valiant-marker-94108%2F20161217t154911.397817632732775351%2Flibs%2Fgettext%2Fgettext.php&line=387&logInsertId=2016-12-17%7C06%3A51%3A14.228127-08%7C10.106.128.65%7C486666032&logNanos=1481986272745392000&nestedLogIndex=88&project=valiant-marker-94108>)
> : eval()'d code on line 1
> 15:51:13.717PHP Notice: Undefined offset: -1 in 
> /base/data/home/apps/s~valiant-marker-94108/20161217t154911.397817632732775351/libs/gettext/gettext.php
> on line 422
> <https://console.cloud.google.com/debug/fromlog?appModule=default&appVersion=20161217t154911&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~valiant-marker-94108%2F20161217t154911.397817632732775351%2Flibs%2Fgettext%2Fgettext.php&line=422&logInsertId=2016-12-17%7C06%3A51%3A14.228127-08%7C10.106.128.65%7C486666032&logNanos=1481986272745392000&nestedLogIndex=89&project=valiant-marker-94108>
>
>
>
> On Sat, 17 Dec 2016 at 13:41 Bruno Haible <br...@clisp.org> 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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
> "Language-Team: LANGUAGE <l...@li.org>\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