From 2471e0158cc7784dadf70167df9be7ca457d0481 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 17 Aug 2005 03:43:20 +0000 Subject: [PATCH] * More work to get the gettext stuff working, although I really don't know what I'm doing here --- webcit/ChangeLog | 5 +++++ webcit/Makefile.in | 2 +- webcit/webcit.h | 17 +++++------------ webcit/webserver.c | 8 ++++++++ 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 49e5fd0a6..f76d8bd00 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,8 @@ $Log$ +Revision 621.9 2005/08/17 03:43:20 ajc +* More work to get the gettext stuff working, although I really don't + know what I'm doing here + Revision 621.8 2005/08/16 20:51:08 ajc * More gettext/i18n crap @@ -2819,3 +2823,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/Makefile.in b/webcit/Makefile.in index c08e53cfc..315824fee 100644 --- a/webcit/Makefile.in +++ b/webcit/Makefile.in @@ -54,7 +54,7 @@ webserver: webserver.o context_loop.o tools.o ical_dezonify.o \ $(LIBOBJS) $(LIBS) $(LDFLAGS) -o webserver .c.o: - $(CC) $(CFLAGS) $(DEFS) -c $(PTHREAD_DEFS) -DWEBCITDIR=\"$(prefix)\" $< + $(CC) $(CFLAGS) $(DEFS) -c $(PTHREAD_DEFS) -DWEBCITDIR=\"$(prefix)\" -DLOCALEDIR=\"$(prefix)/locale\" $< Makefile: $(srcdir)/Makefile.in config.status CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status diff --git a/webcit/webcit.h b/webcit/webcit.h index c28db030f..e507adc41 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -37,21 +37,14 @@ #include #endif +#include "gettext.h" -#ifdef ENABLE_NLS -#ifdef HAVE_LIBINTL_H -#include -#endif -#define _(string) gettext(string) -#define P_(singular, plural, number) ngettext(singular, plural, number) +#if ENABLE_NLS +#include +#define _(string) gettext(string) #else -#define _(string) (string) -#define P_(singular, plural, number) (number == 1 ? singular : plural) +#define _(string) (string) #endif -#define gettext_noop(string) (string) -#define N_(string) gettext_noop(string) - /* Mark a string that will be sent to gettext() later. */ - /* * Uncomment to dump an HTTP trace to stderr diff --git a/webcit/webserver.c b/webcit/webserver.c index a7510d037..1e11f555d 100644 --- a/webcit/webserver.c +++ b/webcit/webserver.c @@ -381,6 +381,14 @@ int main(int argc, char **argv) char tracefile[PATH_MAX]; char ip_addr[256]; char *webcitdir = WEBCITDIR; + char *locale = NULL; + + /* initialize the International Bright Young Thing */ +#ifdef ENABLE_NLS + locale = setlocale(LC_ALL, ""); + bindtextdomain(PACKAGE, LOCALEDIR); + textdomain(PACKAGE); +#endif /* Parse command line */ #ifdef HAVE_OPENSSL -- 2.39.2