Translation breaks IDE

Frédéric Marchal
Fri Mar 17 16:36:00 GMT 2017

On Friday 17 March 2017 09:30:40 David Malcolm wrote:
> This all sounds a lot like:

That's exactly the problem I'm faced with. Thanks for pointing it out to me.

> 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/ 関数 ‘int x2()’ 内:
> /tmp/ エラー: some translated message here
>  x0 x3 = x3.
>     ^~
> /tmp/ 備考: some other translated message here
>  class x0;
>        ^~
> you get:
> /tmp/ In function ‘int x2()’:
> /tmp/ error: the same *translated* message here
>  x0 x3 = x3.
>     ^~
> /tmp/ 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.

Right. We don't want to disable translation completely because the message is 
displayed to the user and it must be displayed in the correct language.

Your solution is much better than the tag I proposed. With your solution, IDEs 
don't have to change anything. The user can add the new command line option 
and get the translation working again. That's great!

> I can implement this for gcc 8.

Debian Jessie is still using gcc 4.9, Debian Squeeze will use version 6. 
QtCreator ships with version 5. Therefore, I expect it will take a long time 
before gcc 8 is used in production. In the meantime, I'll mark the 
translations for "error: " and "warning: " as fuzzy in the French po file along 
with a comment explaining why.

> What should the diagnostic be called?
>   -fdiagnostics-output-format=VALUE
>   -fdiagnostics-mi
>   -fide

If users are expected to add it manually to their IDE's environment, let's 
keep it as simple and to the point as possible. Does it have to start with -f? 
Can't it just be -ide? Or --ide-output-format?

At the very least, the name should be explicit enough. -fdiagnostics-mi 
doesn't talk to me. I fail to see how it relates to a problem with IDEs 
parsing messages…


More information about the Gcc mailing list