From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4640 invoked by alias); 17 Mar 2017 13:30:45 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 4623 invoked by uid 89); 17 Mar 2017 13:30:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.1 required=5.0 tests=BAYES_00,BODY_8BITS,GARBLED_BODY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=D*be, D*perso.be, U*fmarchal, sk:fmarcha X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Mar 2017 13:30:43 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9BEB567EA7; Fri, 17 Mar 2017 13:30:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9BEB567EA7 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dmalcolm@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9BEB567EA7 Received: from vpn-236-41.phx2.redhat.com (vpn-236-41.phx2.redhat.com [10.3.236.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id BAFD01711C; Fri, 17 Mar 2017 13:30:42 +0000 (UTC) Message-ID: <1489757440.28956.61.camel@redhat.com> Subject: Re: Translation breaks IDE From: David Malcolm To: Richard Biener , =?ISO-8859-1?Q?Fr=E9d=E9ric?= Marchal Cc: GCC Development Date: Fri, 17 Mar 2017 13:30:00 -0000 In-Reply-To: References: <8012377.DiHZInmtXg@port-fma> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2017-03/txt/msg00108.txt.bz2 On Fri, 2017-03-17 at 12:20 +0100, Richard Biener wrote: > On Fri, Mar 17, 2017 at 9:48 AM, Frédéric Marchal > wrote: > > Hi, > > > > I gave my partial French translation a field trial this week and it > > didn't went > > well. QtCreator can't see error messages any more if they are > > translated. > > > > QtCreator identifies errors and warnings by parsing gcc output: > > > > file.c:24:5: error: … > > file.c:25:3: warning: … > > > > But if "error" and "warning" are translated it becomes impossible > > to sort out > > the messages. > > > > What can be done to help IDEs with translated messages? > > > > Is it possible to add some --ide-mode flag or some environment > > variable that > > would prefix every message with untranslated hard coded tags that > > could be used > > by IDEs? I'm thinking about something along the line: > > > > (E):file.c:24:5: > > (W): for warnings > > > > These two could be put to use immediately because QtCreator already > > do > > something similar with MSVC. It just lacks something as the above > > mechanism to > > do it with gcc. > > > > And it might be possibly to add other categories that could be used > > later such > > as: > > > > (F): for fatal errors > > (N): for notifications and informations > > (I): included by > > (C): candidates for overloaded functions > > (H): "called from here" or "in this context" > > (!): internal error > > > > This list certainly needs more thinking and IDE folks could give > > more insight > > but you see were I'm heading. > > I think a IDE mode ("machine interface") would be fine. We already > have > -fdiagnostics-parseable-fixits for example, generalizing this to sth > like > -fdiagnostics-mi would be nice. This all sounds a lot like: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79423 Paraphrasing myself from that RFE: given that many IDEs can already parse LANG=C output, presumably you'd want a command-line flag that suppresses just the translation of "error" and "warning" etc, so that instead of output of the form: [with LANG=ja_JP.utf-8] /tmp/test.cc: 関数 ‘int x2()’ 内: /tmp/test.cc:3:4: エラー: some translated message here x0 x3 = x3. ^~ /tmp/test.cc:1:7: 備考: some other translated message here class x0; ^~ you get: /tmp/test.cc: In function ‘int x2()’: /tmp/test.cc:3:4: error: the same *translated* message here x0 x3 = x3. ^~ /tmp/test.cc:1:7: note: again, the message is still translated here class x0; ^~ i.e. that the content of the messages themselves should still be translated, even when in some kind of IDE mode; it's just the "error"/"warning" etc boilerplate that shouldn't be. I can implement this for gcc 8. What should the diagnostic be called? -fdiagnostics-output-format=VALUE -fdiagnostics-mi -fide etc Dave