RFA [PR objc/29200][diagnostic] Make diagnostics translation friendly
David Ayers
ayers@fsfe.org
Fri Apr 3 01:03:00 GMT 2009
Am Freitag, den 03.04.2009, 02:41 +0200 schrieb David Ayers:
> Am Freitag, den 03.04.2009, 02:30 +0200 schrieb David Ayers:
> > here is some more low hanging fruit:
> > "In gcc/objc/objc-act.c there is this code:
> >
> > warning (0, "multiple %s named %<%c%s%> found",
> > methods ? "methods" : "selectors",
> >
> > The strings substituted for the first %s are not available for translation, so
> > this can not be properly translated. Even if they were, composing a sentence
> > like this is not in general possible to do for an arbitrary language."
> >
> > [quoted from: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29200 ]
> >
> > This patch fixes it in straight forward, boring way.
>
> Actually there are a few more places around here that need cleaning
> up... so ignore this patch for now.
Here's what I'm bootstrapping now.
I've verified that currently all calls of warn_with_method supply a
constant string as the message parameter so that the translation can be
called from within warn_with_method. (That's the function at bottom of
the patch which will look like:
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));
}
If it's preferred that the translation be done at the call sites, I can
update the patch accordingly.
OK for the trunk?
Cheers,
David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr29200.patch
Type: text/x-patch
Size: 1769 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090403/e731bc1e/attachment.bin>
More information about the Gcc-patches
mailing list