From patchwork Thu Apr 18 06:34:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1087401 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-499424-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="qY0esTws"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44l8VJ01Psz9s3l for ; Thu, 18 Apr 2019 16:34:57 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; q=dns; s=default; b=U64Y0hvD8HmoV3BePVSFIixRZzL03 N9Or20WQxDPn8BoSNpQEBhl3/dVi3cm//uFBmO+Q2CcrKJ8TyaPHSyeY2JssdkLM 4b7wUZmdVyXaPeBxJzULb5h5CXq/p23J0ytqMCstfVpxB40NCRaKussMffPpt2ty IM/t6TjTx1/Fc0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; s=default; bh=Ya5ilw+Xi1P3DI+h6vSKlgJM1zo=; b=qY0 esTwsDDtl8RhNXCE0+WSm4rRQX5hDA48oaSrmr+LrFWwUjxnhAqK00ugmqz05K+O maCUNUrPUgo2RUXGDWlD/fm2RvQzKnNTmp1mh4IL6NmZ9yD0pn6yOnlUInknwZrP Y9O4UetS0RhsTsBQJ9xk06ZAtUbKrC0aoIDA1/mc= Received: (qmail 56791 invoked by alias); 18 Apr 2019 06:34:49 -0000 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 Received: (qmail 56783 invoked by uid 89); 18 Apr 2019 06:34:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=english X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 Apr 2019 06:34:48 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BAEAAC04AC4B; Thu, 18 Apr 2019 06:34:46 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.40.205.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 487C4600C2; Thu, 18 Apr 2019 06:34:46 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id x3I6Yh1K021454; Thu, 18 Apr 2019 08:34:44 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x3I6YgVY021453; Thu, 18 Apr 2019 08:34:42 +0200 Date: Thu, 18 Apr 2019 08:34:42 +0200 From: Jakub Jelinek To: Richard Biener , Jeff Law Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] i18n fix for gimple-ssa-sprintf.c (PR translation/79183) Message-ID: <20190418063442.GA21066@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.11.3 (2019-02-01) X-IsSubscribed: yes Hi! This patch fixes the following messages, so that they are translatable even to languages that don't use the english Plural-Forms: nplurals=2; plural=n != 1; See https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html#Plural-forms for more details. Bootstrapped/regtested on x86_64-linux and i686-linux, plus generated gcc.pot and eyeballed the changes. Ok for trunk? 2019-04-18 Jakub Jelinek PR translation/79183 * gimple-ssa-sprintf.c (format_directive): Use inform_n instead of inform where appropriate. Jakub --- gcc/gimple-ssa-sprintf.c.jj 2019-04-10 09:26:49.476692760 +0200 +++ gcc/gimple-ssa-sprintf.c 2019-04-17 21:37:51.535294586 +0200 @@ -3016,12 +3016,10 @@ format_directive (const sprintf_dom_walk help the user figure out how big a buffer they need. */ if (min == max) - inform (callloc, - (min == 1 - ? G_("%qE output %wu byte into a destination of size %wu") - : G_("%qE output %wu bytes into a destination of size " - "%wu")), - info.func, min, info.objsize); + inform_n (callloc, min, + "%qE output %wu byte into a destination of size %wu", + "%qE output %wu bytes into a destination of size %wu", + info.func, min, info.objsize); else if (max < HOST_WIDE_INT_MAX) inform (callloc, "%qE output between %wu and %wu bytes into " @@ -3044,11 +3042,9 @@ format_directive (const sprintf_dom_walk of printf with no destination size just print the computed result. */ if (min == max) - inform (callloc, - (min == 1 - ? G_("%qE output %wu byte") - : G_("%qE output %wu bytes")), - info.func, min); + inform_n (callloc, min, + "%qE output %wu byte", "%qE output %wu bytes", + info.func, min); else if (max < HOST_WIDE_INT_MAX) inform (callloc, "%qE output between %wu and %wu bytes",