From patchwork Wed Jul 19 13:28:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 21684 Received: (qmail 8801 invoked by alias); 19 Jul 2017 13:28:27 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 8776 invoked by uid 89); 19 Jul 2017 13:28:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=HTo:D*ucla.edu, poyarekar, Poyarekar, 19072017 X-HELO: mail-qt0-f170.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=aiA1/aZcaTVTCQwicJgtO7ECC3IzvQgN783wnLzg06E=; b=BGJokiIu5FbgmL5T4NR72RX16/yEWac7LdBwnS9XPeHb0eZMfjKMqMnpdoofVP8SQ3 YV17javlsoREH86SQbthaMyv/yawLzPkt8bTmaCz6HzYU5Con6FMwJtCg528FkvZ9e1y urYIZKgGEDtEypvN9RUPGS7V+ItoxJNSRbm4V8CRZ7x2lDKoTz/6c+m3IUjGOqkHBGwD BCO1n8Q9ZjsOaO74rJU6mYgU1Cxt4xz+ePWPx084kviDUx4szqxN4f9EJMqrEGZZuugi psm1gvmj/UVmm7UC3JYUZfwyEWyxUcjLrIPFpDB6wFxvIiGnKbniWZ8DYHeMrjtKzhy2 KnOw== X-Gm-Message-State: AIVw112gTg2bdj/XDSHD3JTjt77WsGQQ4mXs+j8OBbVXNMCIAs77YHqJ eO91fuL0nIK1M20F X-Received: by 10.237.63.246 with SMTP id w51mr134528qth.308.1500470903447; Wed, 19 Jul 2017 06:28:23 -0700 (PDT) Subject: Re: libc-2.25.90.pot To: Benno Schulenberg , Siddhesh Poyarekar , libc-alpha@sourceware.org, Paul Eggert References: <8b9b4e60-f580-e56a-26bc-adb7192ba779@sourceware.org> <6e7f7602-3536-2edb-0cf4-e66a948fdb71@translationproject.org> From: Adhemerval Zanella Message-ID: Date: Wed, 19 Jul 2017 10:28:19 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: On 19/07/2017 04:33, Benno Schulenberg wrote: > Op 19-07-2017 om 09:15 schreef Siddhesh Poyarekar: >> On Wednesday 19 July 2017 12:32 AM, Adhemerval Zanella wrote: >>> >>> And 'PRIdLINENO' is defined as >>> >>> 50 typedef intmax_t lineno; >>> 51 #define PRIdLINENO PRIdMAX >>> >>> Which means we will get different string encodings depending of how >>> __PRI64_PREFIX is defined by the ABI. >>> >>> Both changes came from '92bd70fb' (Update timezone code from tzcode 2017b.) and >>> from original tz project it seems to get from cc8aec6ecb1ecc (zic: some >>> integer-width fixups). TZ commit log seems to indicate this is just a integer >>> cleanup without original from an actual bug or limitation. >>> >>> Paul I think we can use default %d for ints for these two specific printf to >>> make translation work as intended. What do you think? >> >> There are three of those instances and they refer to line numbers in the >> timezone data file. If we can assume that the tzdata files are sane >> then I suppose we could assume %d for these. > > Or at least change them to something that xgettext recognizes. There are > several instances of % and % in the POT file, so xgettext > is able to recognize some of those "PRI..." strings, but seemingly not > custom-defined ones? I think for glibc, since we support C99 intmax_t printf format, we can just use %jd instead: * timezone/zic.c (PRIdLINENO): Remove macro. (verror): Use %jd instead of PRIdLINENO. --- ChangeLog | 5 +++++ timezone/zic.c | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) -- diff --git a/timezone/zic.c b/timezone/zic.c index 068fb43..aaef06b 100644 --- a/timezone/zic.c +++ b/timezone/zic.c @@ -48,7 +48,6 @@ static ptrdiff_t const PTRDIFF_MAX = MAXVAL(ptrdiff_t, TYPE_BIT(ptrdiff_t)); /* The type and printf format for line numbers. */ typedef intmax_t lineno; -#define PRIdLINENO PRIdMAX struct rule { const char * r_filename; @@ -484,10 +483,10 @@ verror(const char *const string, va_list args) ** on BSD systems. */ if (filename) - fprintf(stderr, _("\"%s\", line %"PRIdLINENO": "), filename, linenum); + fprintf(stderr, _("\"%s\", line %jd: "), filename, linenum); vfprintf(stderr, string, args); if (rfilename != NULL) - fprintf(stderr, _(" (rule from \"%s\", line %"PRIdLINENO")"), + fprintf(stderr, _(" (rule from \"%s\", line %jd)"), rfilename, rlinenum); fprintf(stderr, "\n"); } @@ -1250,7 +1249,7 @@ _("\"Zone %s\" line and -p option are mutually exclusive"), if (zones[i].z_name != NULL && strcmp(zones[i].z_name, fields[ZF_NAME]) == 0) { error(_("duplicate zone name %s" - " (file \"%s\", line %"PRIdLINENO")"), + " (file \"%s\", line %jd)"), fields[ZF_NAME], zones[i].z_filename, zones[i].z_linenum);