diff --git a/ci/txpull.sh b/ci/txpull.sh index 610c531d9..b320da300 100755 --- a/ci/txpull.sh +++ b/ci/txpull.sh @@ -25,6 +25,19 @@ test -f "CMakeLists.txt" || { echo "! Not at Calamares top-level" ; exit 1 ; } test -f ".tx/config" || { echo "! Not at Calamares top-level" ; exit 1 ; } test -f "calamares.desktop" || { echo "! Not at Calamares top-level" ; exit 1 ; } + +### FIND EXECUTABLES +# +# +XMLLINT="" +for _xmllint in xmllint +do + $_xmllint --version > /dev/null 2>&1 && XMLLINT=$_xmllint + test -n "$XMLLINT" && break +done +# XMLLINT is optional + + ### FETCH TRANSLATIONS # # Use Transifex client to get translations; this depends on the @@ -33,6 +46,7 @@ test -f "calamares.desktop" || { echo "! Not at Calamares top-level" ; exit 1 ; export QT_SELECT=5 tx pull --force --source --all + ### CLEANUP TRANSLATIONS # # Some languages have been deprecated. They may still exist in Transifex, @@ -52,6 +66,15 @@ drop_language pl_PL { cat calamares.desktop.in ; grep "\\[[a-zA-Z_@]*]=" calamares.desktop ; } > calamares.desktop.new mv calamares.desktop.new calamares.desktop +# And fixup the XML files like in txpush.sh +if test -n "$XMLLINT" ; then + for TS_FILE in lang/calamares_*.ts + do + $XMLLINT --c14n11 "$TS_FILE" | { echo "" ; cat - ; } | $XMLLINT --format --encode utf-8 -o "$TS_FILE".new - && mv "$TS_FILE".new "$TS_FILE" + done +fi + + ### COMMIT TRANSLATIONS # # Produce multiple commits (for the various parts of the i18n