This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, C] PR18249
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Shujing Zhao <pearly dot zhao at oracle dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Paolo Carlini <paolo dot carlini at oracle dot com>
- Date: Wed, 19 May 2010 10:58:41 +0000 (UTC)
- Subject: Re: [PATCH, C] PR18249
- References: <4BF3BDAE.20301@oracle.com>
On Wed, 19 May 2010, Shujing Zhao wrote:
> To fix the problem at cp_parser_name_lookup_error, a translated 'desired'
> would be passed to error_at.
That isn't sufficient. You have:
> @@ -2146,11 +2202,11 @@ cp_parser_name_lookup_error (cp_parser*
> error_at (location, "%qE has not been declared", name);
> }
> else if (parser->scope && parser->scope != global_namespace)
> - error_at (location, "%<%E::%E%> %s", parser->scope, name, desired);
> + error_at (location, "%<%E::%E%> %s", parser->scope, name, _(desired));
> else if (parser->scope == global_namespace)
> - error_at (location, "%<::%E%> %s", name, desired);
> + error_at (location, "%<::%E%> %s", name, _(desired));
> else
> - error_at (location, "%qE %s", name, desired);
> + error_at (location, "%qE %s", name, _(desired));
but (a) some languages might want to put the translated "desired" before
the other piece of the message (%qE etc.), but there's insufficient
context in "%qE %s" for a translator to be able to tell that, and (b) it's
possible the %qE etc. might need to go in the middle of the message, which
can't be handled this way at all. So you should have separate message
strings for each of the above cases and each value of "desired" (there
only seem to be a few such values).
(I have not otherwise reviewed this patch.)
--
Joseph S. Myers
joseph@codesourcery.com