From patchwork Sat Dec 18 19:59:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 76096 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 9D65CB70AF for ; Sun, 19 Dec 2010 07:01:02 +1100 (EST) Received: (qmail 25322 invoked by alias); 18 Dec 2010 20:01:01 -0000 Received: (qmail 25313 invoked by uid 22791); 18 Dec 2010 20:01:00 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 18 Dec 2010 20:00:55 +0000 Received: (qmail 18347 invoked from network); 18 Dec 2010 20:00:54 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 18 Dec 2010 20:00:54 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1PU2wO-0003vR-TX for gcc-patches@gcc.gnu.org; Sat, 18 Dec 2010 19:59:52 +0000 Date: Sat, 18 Dec 2010 19:59:40 +0000 (UTC) From: "Joseph S. Myers" To: gcc-patches@gcc.gnu.org Subject: Fix .pot merging for singular/plural message Message-ID: MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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));