This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, C] PR18249


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]