This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix .pot merging for singular/plural message

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  <>

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

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));

Joseph S. Myers

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]