[Freeipa-devel] [PATCH] Gettextize the sss_ tools
Jakub Hrozek
jhrozek at redhat.com
Wed Jun 24 17:00:10 UTC 2009
-----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).
Jakub
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAkpCW5oACgkQHsardTLnvCUZBQCgiaBnA8EfM0Dd/cxab7fzTMw0
Ek4AoOwkN0dDueRQI4hLz/wAL3l4FEin
=a4OE
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-print_error-inline-function.patch
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20090624/0f499387/attachment.ksh>
More information about the Freeipa-devel
mailing list