[Freeipa-devel] [PATCH] Gettextize the sss_ tools
Simo Sorce
ssorce at redhat.com
Wed Jun 24 17:59:26 UTC 2009
On Wed, 2009-06-24 at 19:00 +0200, Jakub Hrozek wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 06/19/2009 08:59 PM, Simo Sorce wrote:
> > Looking at this patch I realize that we used DEBUG() improperly here.
> > DEBUG() shouldn't be used to return errors, but to aid in debugging.
> > So we should probably split the DEBUG statements used here in 2.
> >
> > 1. A set of PRINT() statements for messages intended to be returned to
> > users, these messages will be localized, and localization should be part
> > of the macro itself. Also any time more than 2 parameters are required,
> > we should use positionals because the position of an expanded parameter
> > may vary depending on the language.
> >
> > 2. A set of DEBUG() statements for messages intended to be seen only
> > during debugging. These *should not* be translated.
> >
> >
> > Comments ?
>
> I agree that we should separate DEBUG and PRINT and I agree with the
> translation part.
>
> Would an inline function like the one in the attached patch be
> acceptable for you? The problem I see with macros is that we probably
> would use something like:
>
> #define PRINT(fmt, ...) fprintf(stderr, gettext(fmt), ##__VA_ARGS__)
>
> while the ## part is a gcc extension (so that the macro is usable even
> when called only with fmt).
I think you can use the same stuff we use for DEBUG and have a print_fn
function.
That should be more portable if we care about the above being too gcc
specific.
Simo.
--
Simo Sorce * Red Hat, Inc * New York
More information about the Freeipa-devel
mailing list