[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Documentation of ngettext
From: |
Bruno Haible |
Subject: |
Re: Documentation of ngettext |
Date: |
Tue, 27 Nov 2001 15:37:39 +0100 (CET) |
Akim Demaille writes:
> I'd like to suggest that the default macros, with !ENABLE_NLS,
> described in the documentation, be extended with the new functions.
> In particular, if someone --disables-nls
Thanks for the suggestion. I've put this on my todo list for gettext 0.11.
> the project really needs something like:
>
> #ifdef HAVE_LOCALE_H
> # include <locale.h>
> #endif
Nowadays all systems have <locale.h>.
> #ifdef ENABLE_NLS
> # include <libintl.h>
> # define _(Text) gettext (Text)
> #else
> # undef bindtextdomain
> # define bindtextdomain(Domain, Directory)
> # undef textdomain
> # define textdomain(Domain)
> # undef ngettext
> # define ngettext(Singular, Plural, Number) \
> ((Number == 1) ? Singular : Plural)
> # define _(Text) Text
> #endif
> #define N_(Text) Text
>
> to work properly.
You get all this in a single line through #include "libgettext.h",
using the libgettext.h from gettext-0.10.40.
> (Oh, BTW, may I also suggest that the calling convention of
> AM_GNU_GETTEXT be described with its arguments?
Makes sense, yes.
> And why AM_?.
Because at some time that was the customary prefix for all GNU
packages' m4 macros except autoconf itself.
Bruno