Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Aleksandar Ristovski <aristovski@qnx.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [patch] catchpoints bring output in-line with breakpoints output
Date: Tue, 27 May 2008 23:25:00 -0000	[thread overview]
Message-ID: <uk5hf8thk.fsf@gnu.org> (raw)
In-Reply-To: <g1hknu$ap3$1@ger.gmane.org>

> From:  Aleksandar Ristovski <aristovski@qnx.com>
> Date:  Tue, 27 May 2008 14:43:10 -0400
> 
> > This patch brings catchpoint output in line with breakpoints output:

Thanks!  I have one comment on your changes:

>  static enum print_stop_action
>  print_exception_catchpoint (struct breakpoint *b)
>  {
> +  int bp_temp;
> +  char msg[160];
> +  const char * msgspec;
> +  const char msgfmt[] = "\n%s %d (exception %s)\n";

This is not a good idea, because it defeats translation.  For
starters, this format string will not be caught by xgettext and won't
be in the message catalog.  Moreover, ...

> +  sprintf (msg, msgfmt, 
> +	   bp_temp ? "Temporary catchpoint" : "Catchpoint", 
> +	   b->number, msgspec);

... this kind of assembly of a sentence on the flight is bad, because
it doesn't leave the translators an opportunity to see a complete
phrase, and thus the concatenation of 2 fragments translated
independently might well produce a sentence that is invalid in the
target language.

Please instead use the technique you used in another portion of the patch:

> +    printf_filtered (bp_temp ? _("Temporary catchpoint %d (throw)")
> +			     : _("Catchpoint %d (throw)"), b->number);
>    else
> -    printf_filtered (_("Catchpoint %d (catch)"), b->number);
> +    printf_filtered (bp_temp ? _("Temporary catchpoint %d (catch)")
> +			     : _("Catchpoint %d (catch)"), b->number);

Here, the complete phrases are used, and the small waste of space for
repeating the common part is well worth the gain.


  reply	other threads:[~2008-05-27 18:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-27 20:01 Aleksandar Ristovski
2008-05-27 21:32 ` Aleksandar Ristovski
2008-05-27 23:25   ` Eli Zaretskii [this message]
2008-05-28 15:20     ` Aleksandar Ristovski
2008-05-28 16:25       ` Eli Zaretskii
2008-05-28 19:31         ` Aleksandar Ristovski

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=uk5hf8thk.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=aristovski@qnx.com \
    --cc=gdb-patches@sources.redhat.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