]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Polish translation mechanism
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 12 Aug 2008 12:59:50 +0000 (00:59 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 12 Aug 2008 12:59:50 +0000 (00:59 +1200)
Adds an automatic test for po2html binary and only attempts translation
if one is located.
The po2html path can be specified using: --with-po2html=/path/po2html

configure.in
errors/Makefile.am

index 98d03384d1486176a247c2f64ee95e062b9af3c1..43ae513a45ddf64f07ff3e0fe250f7ed2f0357a5 100755 (executable)
@@ -3659,22 +3659,9 @@ if test $ac_cv_have_res_ns_list = "yes" ; then
 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 Squid now has .po translation capability, given the right toolkit
+AX_WITH_PROG([PO2HTML],[po2html])
+AC_SUBST(PO2HTML)
 
 dnl Squid now has limited locale handling ...
 dnl on error pages
index 22f8c00ab67e7bd62aa87976adcaa81ef69ca026..ccf62160820bfe6907def926372588b1c212b890 100644 (file)
@@ -111,7 +111,7 @@ addlang: all
 
 dist-hook:
        for lang in $(LANGUAGES); do \
-         if test "$$lang" = .; then :; else \
+         if test -d $(srcdir)/$$lang ; then \
            test -d $(distdir)/$$lang \
            || mkdir $(distdir)/$$lang \
            || exit 1; \
@@ -119,28 +119,33 @@ dist-hook:
              || exit 1; \
          fi; \
        done; \
-       if test "$(DO_TRANSLATE)" = "yes" ; then \
-               make translate; \
+       make translate; \
+       for lang in $(TRANSLATIONS); do \
+         if test -d $(srcdir)/$$lang ; then \
                test -d $(distdir)/$$lang \
                  || mkdir $(distdir)/$$lang \
                  || exit 1; \
                cp -p $(srcdir)/$$lang/ERR_*  $(distdir)/$$lang \
                  || exit 1; \
-       fi
+         fi; \
+       done
 
 translate:
-       for lang in $(TRANSLATIONS); do \
+       if test "$(PO2HTML)" != "" ; then \
+         for lang in $(TRANSLATIONS); do \
                test -d $$lang && rm -r $$lang; \
                mkdir $$lang; \
                cd $$lang; \
                for f in `ls -1 ../templates`; do \
-                       echo "po2html -i ../$$lang.po -t ../templates/$$f"; \
-                       po2html -i ../$$lang.po -t ../templates/$$f >$$f || exit 1; \
+                       $(PO2HTML) -i ../$$lang.po -t ../templates/$$f >$$f || exit 1; \
                done; \
                cd ..; \
-       done
+         done; \
+       else \
+         echo "WARNING: Translation toolkit was not detected."; \
+         echo "A drop-in bundle of pre-translated files is available from"; \
+         echo "http://www.squid-cache.org/Versions/langpack/"; \
+       fi
 
 all:
-       if test "$(DO_TRANSLATE)" = "yes" ; then \
-               make translate; \
-       fi
+       make translate