[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] AM_GNU_GETTEXT([external]) disables NLS
From: |
Bruno Haible |
Subject: |
Re: [PATCH] AM_GNU_GETTEXT([external]) disables NLS |
Date: |
Mon, 4 Jul 2005 13:23:29 +0200 |
User-agent: |
KMail/1.5 |
Hello Sergey,
> Thus GNU awk and any programs using an approach similar to that of gawk,
> are effectively distributed witout NLS support.
Thanks for noticing the problem and reporting it. Sorry for the delay on
my side.
> dnl initialize GNU gettext
> AM_GNU_GETTEXT([external])
> AM_GNU_GETTEXT_VERSION([0.14.4])
>
> Its main() contains:
>
> ##if HAVE_LC_MESSAGES && defined(LC_MESSAGES)
> setlocale(LC_MESSAGES, "");
> ##endif
>
> Now, checking for LC_MESSAGES occurs in gettext-runtime/m4/gettext.m4,
> in defun AM_INTL_SUBDIR. This function is called from AM_GNU_GETTEXT
> only if variable gt_included_intl equals to `yes', which in turn
> occurs only if the first argument to AM_GNU_GETTEXT is not `external'.
About this issue, whether LC_MESSAGES is defined or not, the GNU gettext
manual says:
On all POSIX conformant systems the locale categories `LC_CTYPE',
`LC_MESSAGES', `LC_COLLATE', `LC_MONETARY', `LC_NUMERIC', and `LC_TIME'
are available. On some systems which are only ISO C compliant,
`LC_MESSAGES' is missing, but a substitute for it is defined in GNU
gettext's `<libintl.h>'.
This implies that the recommended code (for GNU awk and other packages)
is
#include <locale.h>
#include "gettext.h" /* conditionally includes <libintl.h> */
...
#ifdef LC_MESSAGES
setlocale(LC_MESSAGES, "");
#endif
The #ifdef is only needed for portability to very ancient hosts and only
for when --disable-nls is used (because then, gettext.h does not include
<libintl.h>).
> Proposed is a patch to gettext-runtime/m4/gettext.m4 that moves checking
> for LC_MESSAGES to AM_GNU_GETTEXT (see attachment).
This patch will not be applied, because HAVE_LC_MESSAGES is not and never
was documented, and it doesn't help the developer who follows the GNU
gettext documentation.
Thanks anyway. Do you know other programs which use HAVE_LC_MESSAGES and
better shouldn't?
Bruno