bug-gettext
[Top][All Lists]
Advanced

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

Re: [bug-gettext] Plural forms


From: Bruno Haible
Subject: Re: [bug-gettext] Plural forms
Date: Sat, 17 Dec 2016 13:41:29 +0100
User-agent: KMail/4.8.5 (Linux/3.8.0-44-generic; KDE/4.8.5; x86_64; ; )

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]