From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B187A3858D39; Fri, 4 Mar 2022 10:10:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B187A3858D39 From: "redi at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2022 10:10:24 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104709 --- Comment #1 from Jonathan Wakely --- 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, con= st 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.=