summaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorJoe Orton <notroj@users.noreply.github.com>2005-08-19 09:24:20 +0000
committerJoe Orton <notroj@users.noreply.github.com>2005-08-19 09:24:20 +0000
commite739c8b79c15aa1e5f57d9b9500c4edcd85a0a4e (patch)
tree81add0fe7d10d31265a5e397735d6b2ee9ce3dc7 /Makefile.in
parent928a36b1eac7853e863b9d94a07af30cef5189ac (diff)
downloadneon-git-e739c8b79c15aa1e5f57d9b9500c4edcd85a0a4e.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.
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