From b35c911d73e4517c0d4ed8d02a15c726c05f8b4e Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 17 Nov 2005 05:03:54 +0000 Subject: [PATCH] * Assorted tweaks to activate the translations... --- webcit/ChangeLog | 3 +++ webcit/Makefile.in | 45 ++++++++++++++++++++++++++++++++++++++++++--- webcit/configure.in | 3 +++ webcit/webserver.c | 23 ++++++++++++++++------- 4 files changed, 64 insertions(+), 10 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 0ebff19a3..bdc78e35b 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,5 +1,8 @@ $Id$ +Tue Nov 17 00:03:20 EST 2005 ajc +* Assorted tweaks to activate the translations... + Tue Nov 15 21:58:09 EST 2005 ajc * Checked in po/de.po, a German translation submitted by Wilifried Goesgens. Now I just have to figure out how to activate it. diff --git a/webcit/Makefile.in b/webcit/Makefile.in index a295d043d..600b46ce4 100644 --- a/webcit/Makefile.in +++ b/webcit/Makefile.in @@ -12,10 +12,16 @@ SETUP_LIBS=@SETUP_LIBS@ PTHREAD_DEFS=@PTHREAD_DEFS@ srcdir=@srcdir@ prefix=@prefix@ +top_builddir=`pwd` + +LIB_SUBDIRS= +PROG_SUBDIRS=po +SUBDIRS=$(LIB_SUBDIRS) $(PROG_SUBDIRS) # End of configuration section -all: webserver setup +all: all-progs-recursive webserver setup + .SUFFIXES: .c .o @@ -23,7 +29,8 @@ clean: rm -f *.o webcit webserver distclean: clean - rm -f Makefile config.cache config.log config.status + rm -f Makefile config.cache config.log config.status\ + $(srcdir)/TAGS setup: setup.o tools.o $(CC) setup.o tools.o \ @@ -57,7 +64,7 @@ webserver: webserver.o context_loop.o tools.o ical_dezonify.o \ $(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 + CONFIG_FILES="Makefile po/Makefile" CONFIG_HEADERS= $(SHELL) ./config.status config.status: $(srcdir)/configure $(SHELL) ./config.status --recheck @@ -80,3 +87,35 @@ install: ; do \ $(INSTALL) $$i $(root)$(prefix)/$$i; \ done + +TAGS clean-recursive distclean-recursive depend-recursive check-recursive \ + mostlyclean-recursive realclean-recursive: + @for subdir in $(SUBDIRS); do \ + if test -d $$subdir ; then \ + target=`echo $@|$(SED) 's/-recursive//'`; \ + echo making $$target in $$subdir; \ + (cd $$subdir && $(MAKE) $$target) || exit 1; \ + fi ; \ + done + +all-progs-recursive install-progs-recursive install-strip-progs-recursive \ + uninstall-progs-recursive: + @for subdir in $(PROG_SUBDIRS); do \ + if test -d $$subdir ; then \ + target=`echo $@|$(SED) 's/-progs-recursive//'`; \ + echo making $$target in $$subdir; \ + (cd $$subdir && $(MAKE) $$target) || exit 1; \ + fi ; \ + done + +all-libs-recursive install-libs-recursive install-strip-libs-recursive \ + uninstall-libs-recursive install-shlibs-libs-recursive \ + install-shlibs-strip-libs-recursive uninstall-shlibs-libs-recursive: + @for subdir in $(LIB_SUBDIRS); do \ + if test -d $$subdir ; then \ + target=`echo $@|$(SED) 's/-libs-recursive//'`; \ + echo making $$target in $$subdir; \ + (cd $$subdir && $(MAKE) $$target) || exit 1; \ + fi ; \ + done + diff --git a/webcit/configure.in b/webcit/configure.in index acabc4268..d45142462 100644 --- a/webcit/configure.in +++ b/webcit/configure.in @@ -78,6 +78,9 @@ AC_HEADER_STDC dnl AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h) + + + dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_OFF_T diff --git a/webcit/webserver.c b/webcit/webserver.c index 092236442..91a1dfa5c 100644 --- a/webcit/webserver.c +++ b/webcit/webserver.c @@ -383,13 +383,7 @@ int main(int argc, char **argv) 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 + char *mo = NULL; /* Parse command line */ #ifdef HAVE_OPENSSL @@ -465,6 +459,21 @@ int main(int argc, char **argv) perror("chdir"); } + /* initialize the International Bright Young Thing */ +#ifdef ENABLE_NLS + locale = setlocale(LC_ALL, ""); + + mo = malloc(strlen(webcitdir) + 20); + sprintf(mo, "%s/locale", webcitdir); + lprintf(9, "Message catalog directory: %s\n", + bindtextdomain("webcit", mo) + ); + free(mo); + lprintf(9, "Text domain: %s\n", + textdomain("webcit") + ); +#endif + /* * Set up a place to put thread-specific data. * We only need a single pointer per thread - it points to the -- 2.30.2