This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] Java: Prepare for %q, %< and %> in diagnostic messages
Ranjit Mathew <rmathew@gmail.com> writes:
>> >> While you're at it, please make the messages be properly translated
>> >> (see ABOUT-GCC-NLS in the source tree).
>> >>
>> >> zw
>> >
>> > If I understand you correctly, this would just
>> > mean changing the parameter name from "msg"
>> > to "msgid" so that the message extractors pick
>> > it up correctly, right?
>>
>> That, and tracing the data flow and making sure that the string is
>> passed through _() exactly once.
>
> Thanks. I think that part is taken care of
> already - parse_error_context() and parse_warning_context()
> call issue_error_warning_from_context(), which calls
> warning() or error() in the core GCC framework, which
> then ensures that the translation is done only once.
It does do that, but I think it does it too late. [I'm not totally
sure about this, because I cannot find the definition of java_error().]
The call to _() [aka gettext()] has to happen _before_ any other
transformations are done to the string, or the string won't match what
was put into the translation database.
Note also that java_lex_error() needs similar treatment.
zw