public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: binutils@sourceware.org
Cc: "Felipe E. F. de Castro" <fefcas@gmail.com>
Subject: [PATCH binutils] gprof: add no-c-format comment for msgid '%time'
Date: Tue, 19 Apr 2011 03:56:00 -0000	[thread overview]
Message-ID: <20110419035454.GA27588@elie> (raw)
In-Reply-To: <20110417193136.29404.28033.reportbug@fel>

The %time column heading in call graph profiles looks to xgettext like
a printf format.  When translators are confident to really translate
it, the msgfmt program complains that the translation is malformed,
which prevents the translation robot (of the Translation Project) from
accepting the translation.

But this is really just a plain string.  Let xgettext know so by
adding an xgettext:no-c-format comment to override the auto-detection.

Reported-by: Felipe E. F. de Castro <fefcas@gmail.com>
---
Hi,

Felipe E. F. de Castro wrote[1]:

> In the file cg_print.c, there is a translatable string which makes
> gettext think it is in C-format, while in fact it is not:
> _("%time")

How about this patch?  Untested.

[1] http://bugs.debian.org/623151

 gprof/ChangeLog  |    5 +++++
 gprof/cg_print.c |    7 +++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/gprof/ChangeLog b/gprof/ChangeLog
index abb7959..6558b5f 100644
--- a/gprof/ChangeLog
+++ b/gprof/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-18  Jonathan Nieder  <jrnieder@gmail.com>
+
+	* cg_print.c (print_header): Add no-c-format comment to prevent
+	confusion when translating "%time".
+
 2011-03-30  Nick Clifton  <nickc@redhat.com>
 
 	* po/eo.po: New Esperanto translation.
diff --git a/gprof/cg_print.c b/gprof/cg_print.c
index c1a2a31..de13f72 100644
--- a/gprof/cg_print.c
+++ b/gprof/cg_print.c
@@ -96,8 +96,11 @@ print_header ()
       printf ("%6.6s %5.5s %7.7s %11.11s %7.7s/%-7.7s     %-8.8s\n",
 	      "", "", "", "", _("called"), _("total"), _("parents"));
       printf ("%-6.6s %5.5s %7.7s %11.11s %7.7s+%-7.7s %-8.8s\t%5.5s\n",
-	      _("index"), _("%time"), _("self"), _("descendants"),
-	      _("called"), _("self"), _("name"), _("index"));
+	      _("index"),
+	      /* xgettext:no-c-format */
+	      _("%time"),
+	      _("self"), _("descendants"), _("called"), _("self"),
+	      _("name"), _("index"));
       printf ("%6.6s %5.5s %7.7s %11.11s %7.7s/%-7.7s     %-8.8s\n",
 	      "", "", "", "", _("called"), _("total"), _("children"));
       printf ("\n");
-- 
1.7.5.rc2

       reply	other threads:[~2011-04-19  3:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20110417193136.29404.28033.reportbug@fel>
2011-04-19  3:56 ` Jonathan Nieder [this message]
2011-04-28  5:13   ` Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110419035454.GA27588@elie \
    --to=jrnieder@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=fefcas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).