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: RFA [PR objc/29200][diagnostic] Make diagnostics translation friendly


David Ayers <ayers@fsfe.org> writes:

> This is a diagnostics bug fix to improve the ability to translate
> certain strings in the Objective-C frontend.  Certain strings are being
> constructed in a local function:
>
> static void
> warn_with_method (const char *message, int mtype, tree method)
> {
>   /* Add a readable method name to the warning.  */
>   warning (0, "%J%s %<%c%s%>", method,
>            _(message), mtype, gen_method_decl (method));
> }
>
> The _() around MESSAGE is introduced by this patch. To repeat the quite
> above: I've verified that currently all calls to warn_with_method supply
> a constant string as the message parameter so that the translation can
> be called from within warn_with_method.

You need to rename the parameter message to msgid (or something else
ending in msgid) so that gcc/po/exgettext can recognize the function
properly as one that takes translatable strings.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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