Patchwork Fix .pot merging for singular/plural message

login
register
mail settings
Submitter Joseph S. Myers
Date Dec. 18, 2010, 7:59 p.m.
Message ID <Pine.LNX.4.64.1012181959040.20845@digraph.polyomino.org.uk>
Download mbox | patch
Permalink /patch/76096/
State New
Headers show

Comments

Joseph S. Myers - Dec. 18, 2010, 7:59 p.m.
It appears xgettext, when used to merge .pot files as in exgettext,
cannot handle the same message appearing both as an ordinary message
for translation and as a singular form in a singular/plural pair.

The messages "candidate is:" and "candidates are:" appeared like that
in the C++ front end.  This patch fixes the exgettext failure by
moving one use to ngettext (the other is using inform_n).

Bootstrapped with no regressions on x86_64-unknown-linux-gnu.  Applied
to mainline.

2010-12-18  Joseph Myers  <joseph@codesourcery.com>

	* pt.c (most_specialized_class): Use ngettext to determine
	"candidates are:" / "candidate is" message.

Patch

Index: pt.c
===================================================================
--- pt.c	(revision 168023)
+++ pt.c	(working copy)
@@ -16512,7 +16512,7 @@  most_specialized_class (tree type, tree
       if (!(complain & tf_error))
 	return error_mark_node;
       error ("ambiguous class template instantiation for %q#T", type);
-      str = TREE_CHAIN (list) ? _("candidates are:") : _("candidate is:");
+      str = ngettext ("candidate is:", "candidates are:", list_length (list));
       for (t = list; t; t = TREE_CHAIN (t))
         {
           error ("%s %+#T", spaces ? spaces : str, TREE_TYPE (t));