summaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2005-08-19 09:24:20 +0000
committerjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2005-08-19 09:24:20 +0000
commitef3565de9526bf9b23097b820a21d9893c87861a (patch)
tree81add0fe7d10d31265a5e397735d6b2ee9ce3dc7 /Makefile.in
parent03916caccf27c16dfa3f70788f7c796f885c953d (diff)
downloadneon-ef3565de9526bf9b23097b820a21d9893c87861a.tar.gz
Implement support for internationalization of error message:
* src/Makefile.in (NEON_BASEOBJS): Build ne_i18n.o. * src/ne_i18n.c: Include config.h, ne_i18n.h. (ne_i18n_init): Renamed from neon_i18n_init. * src/ne_i18n.h: Remove library-private definition of '_' and 'N_' macros. * src/ne_internal.h: New header; add definitions of _ and N_. * src/*.c: Update all sources to include ne_internal.h instead of ne_i18n.h. * po/: New directory. Add message catalog template and translated message catalogs extracted from sitecopy. * macros/neon-test.m4: Check for setlocale and locale.h. * test/common/tests.c: Include locale.h, ne_i18n.h. (main): Call setlocale and ne_i18n_init. * test/run.sh: By default disable i18n to allow checks for English error messages to succeed. * .release.sh: Compile the gmo files here. * macros/neon.m4 (NEON_I18N): Add macro. * configure.in: Use NEON_I18N. Define ALL_LINGUAS. git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@680 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in35
1 files changed, 33 insertions, 2 deletions
diff --git a/Makefile.in b/Makefile.in
index dd82e6a..4d75a3f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -25,6 +25,7 @@ docdir = $(datadir)/doc/neon-@NEON_VERSION@
includedir = @includedir@
neonincludes = $(includedir)/neon
pkgconfigdir = $(libdir)/pkgconfig
+localedir = $(datadir)/locale
top_srcdir = @top_srcdir@
top_builddir = .
@@ -43,9 +44,16 @@ INSTALL = @INSTALL@
transform = @program_transform_name@
LIBTOOL = @LIBTOOL@
-
XMLTO = xmlto
GCOV = gcov
+XGETTEXT_OPTS = --keyword=_ --keyword=N_ --msgid-bugs-address=neon@webdav.org \
+ --default-domain=neon
+POTFILE = $(top_srcdir)/po/neon.pot
+XGETTEXT = xgettext
+MSGFMT = msgfmt
+MSGMERGE = msgmerge
+
+LINGUAS = @ALL_LINGUAS@
# The headers to distribute - making up the public interface of neon
DIST_HEADERS = ne_request.h ne_session.h ne_utils.h ne_uri.h ne_socket.h \
@@ -137,7 +145,7 @@ install-memleak:
@echo "ERROR: purposes only; this copy of neon must not be installed."
@false
-install-yes: install-lib install-headers install-config install-docs
+install-yes: install-lib install-headers install-config install-docs install-nls
# libtool does all the necessary magic here
install-lib: subdirs
@@ -164,6 +172,29 @@ install-config: neon-config neon.pc
install-tests: install-lib
@cd test && make install
+install-nls: install-nls-@NE_FLAG_I18N@
+
+install-nls-no:
+ @echo NLS not enabled.
+
+install-nls-yes:
+ @for f in $(LINGUAS); do \
+ $(INSTALL) -d $(DESTDIR)$(localedir)/$$f/LC_MESSAGES; \
+ $(INSTALL_DATA) po/$$f.gmo $(DESTDIR)$(localedir)/$$f/LC_MESSAGES/neon.mo; \
+ done
+
ChangeLog:
svn log > $@
+update-po:
+ @xgettext $(XGETTEXT_OPTS) $(top_srcdir)/src/ne*.c -o $(POTFILE)
+ @for f in $(LINGUAS); do \
+ echo "> Updating \"$$f\" catalog:"; \
+ $(MSGMERGE) --update $(top_srcdir)/po/$$f.po $(POTFILE); \
+ done
+
+compile-gmo:
+ @for f in $(LINGUAS); do \
+ echo "> Compiling \"$$f\" catalog:"; \
+ $(MSGFMT) --statistics -c -o po/$$f.gmo $(top_srcdir)/po/$$f.po; \
+ done