* More work to get the gettext stuff working, although I really don't
authorArt Cancro <ajc@citadel.org>
Wed, 17 Aug 2005 03:43:20 +0000 (03:43 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 17 Aug 2005 03:43:20 +0000 (03:43 +0000)
  know what I'm doing here

webcit/ChangeLog
webcit/Makefile.in
webcit/webcit.h
webcit/webserver.c

index 49e5fd0a6c118e608bda6e9accb7ffdd176e8ed8..f76d8bd0020c608b359aa4c5422d1e5670dffa28 100644 (file)
@@ -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 <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index c08e53cfc30234fb679610b907521761fccd3843..315824fee4fc0ef1ea4b4161538cb1bfedb9c199 100644 (file)
@@ -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
index c28db030f87ed9cf7a6664abc418a19b4c4cb918..e507adc41a07176c0bb6bd3b7357a67266351c69 100644 (file)
 #include <iconv.h>
 #endif
 
+#include "gettext.h"
 
-#ifdef ENABLE_NLS
-#ifdef HAVE_LIBINTL_H
-#include <libintl.h>
-#endif
-#define _(string) gettext(string)
-#define P_(singular, plural, number) ngettext(singular, plural, number)
+#if ENABLE_NLS
+#include <locale.h>
+#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
index a7510d03798d6446464d0b74eda090585e298ec1..1e11f555d6c00fd1a26d44e7d7191524fbd9c286 100644 (file)
@@ -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