From: Amos Jeffries Date: Tue, 12 Aug 2008 12:59:50 +0000 (+1200) Subject: Polish translation mechanism X-Git-Tag: SQUID_3_1_0_1~49^2~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4b70b44f2c6844584c234a48b58bc73dc70541e;p=thirdparty%2Fsquid.git Polish translation mechanism 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 --- diff --git a/configure.in b/configure.in index 98d03384d1..43ae513a45 100755 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/errors/Makefile.am b/errors/Makefile.am index 22f8c00ab6..ccf6216082 100644 --- a/errors/Makefile.am +++ b/errors/Makefile.am @@ -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