Round 3 of this one.
Just the process of creating pre-translated error templates from .po
- installs/uninstalls base templates for failover backup if no
translation is done.
No other changes from round 2:
* Adds dependency on translation toolkit po2html for 'make dist' target.
* Adds 'make translate' target
* Adjusts 'make all' to do translation.
* Adds --without-po2html configure option to optionally skip the
translation step unless explicitly asked for ('make translate').
* Installs translated files properly, and skips silently if missing.
* Un-installs translated files, and skips silently if missing.
Amos
--
Please use Squid 2.7.STABLE3 or 3.0.STABLE8
=== modified file 'errors/Makefile.am'
--- errors/Makefile.am 2008-07-21 12:13:25 +0000
+++ errors/Makefile.am 2008-07-28 00:34:37 +0000
@@ -61,7 +61,7 @@
$(INSTALL_DATA) $$f $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l; \
done; \
done; \
- for l in $(TRANSLATIONS) ; do \
+ for l in $(TRANSLATIONS) templates; do \
if test -d $(srcdir)/$$l; then \
$(mkinstalldirs) $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l && \
for f in $(srcdir)/$$l/ERR_*; do \
@@ -77,7 +77,7 @@
rm -f $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l/`basename $$f`; \
done; \
done; \
- for l in $(TRANSLATIONS); do \
+ for l in $(TRANSLATIONS) templates; do \
if test -d $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l; then \
for f in $(srcdir)/$$l/ERR_*; do \
rm -f $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l/`basename $$f`; \
=== modified file 'configure.in'
--- configure.in 2008-07-11 19:32:10 +0000
+++ configure.in 2008-07-23 11:33:48 +0000
@@ -3694,6 +3694,23 @@
fi
fi
+dnl Squid now has limited locale handling ...
+DO_TRANSLATE="yes"
+AC_ARG_WITH(po2html,
+[ --without-po2html Translation toolkit is required to auto-build translated
+ error pages. If it is not present this option can be used
+ to run the 'make dist' target without translating.
+ A drop-in bundle of pre-translated files is available from
+ http://www.squid-cache.org/Versions/v3/HEAD/
+],
+[ if test "$enableval" != "yes" ; then
+ echo "Disabling Translation Toolkit dependency"
+ DO_TRANSLATE="no"
+ fi
+])
+AC_SUBST(DO_TRANSLATE)
+
+
dnl Need the debugging version of malloc if available
XTRA_OBJS=''
if test "$ac_cv_lib_malloc_main" = "yes" ; then
=== modified file 'errors/update-pot.sh'
--- errors/update-pot.sh 2008-07-15 12:11:23 +0000
+++ errors/update-pot.sh 2008-07-23 11:33:48 +0000
@@ -1,4 +1,4 @@
-#/bin/sh
+#!/bin/sh
#
# Update the core dictionary file from the basic templates
# Useful if any template has altered.
@@ -25,11 +25,12 @@
) >dictionary.pot
# Update all existing dictionaries with the new content ...
-for f in `ls -1 ./*.po` ; do
-
-# NP: this does not yet fully work. Old dictionaries upgrading still needs a little work.
-
-# msgmerge --verbose -s --no-wrap -o ${f}.new ${f} dictionary.pot
-
- # TODO check that the merge actually removes translations which are now obsolete???
-done
+#for f in `ls -1 ./*.po` ; do
+#
+#
+## NP: this does not yet fully work. Old dictionaries upgrading still needs a little work.
+#
+## msgmerge --verbose -s --no-wrap -o ${f}.new ${f} dictionary.pot
+#
+# # TODO check that the merge actually removes translations which are now obsolete???
+#done