public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/104709] A translated error message will include untanslated parts
Date: Fri, 04 Mar 2022 10:10:24 +0000	[thread overview]
Message-ID: <bug-104709-4-eXCJiAdakN@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104709-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104709

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
A small improvement would be:

--- a/gcc/cp/mapper-client.cc
+++ b/gcc/cp/mapper-client.cc
@@ -304,8 +304,13 @@ module_client::open_module_client (location_t loc, const
char *o,
 #endif

   if (errmsg)
-    error_at (loc, line ? G_("failed %s mapper %qs line %u")
-             : G_("failed %s mapper %qs"), errmsg, name.c_str (), line);
+    {
+      if (line)
+       error_at (loc, G_("error in mapper %qs at line %u: %s"), name.c_str (),
+                 line, errmsg);
+      else
+       error_at (loc, G_("error in mapper %qs: %s"), name.c_str (), errmsg);
+    }

   // now wave hello!
   c->Cork ();



That way at least the untranslated part is always at the end, rather than
embedded in the middle of a translated string.

It's not really clear whether the current errors are ideal even for English
output, e.g. Cody::OpenInet6 might set errmsg to "socket" which would yield
something like:

failed socket mapper 'name' at line N

I think this means it failed to *open* a socket for the mapper, but that's not
how it reads.

  parent reply	other threads:[~2022-03-04 10:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-27 10:51 [Bug c++/104709] New: " goeran at uddeborg dot se
2022-02-28  9:21 ` [Bug c++/104709] " redi at gcc dot gnu.org
2022-03-04 10:10 ` redi at gcc dot gnu.org [this message]
2022-03-04 10:37 ` jakub at gcc dot gnu.org
2022-03-11 10:47 ` redi at gcc dot gnu.org

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=bug-104709-4-eXCJiAdakN@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).