[BUGFIX] ll-XML fails to be converted to XLIFF 28/42128/2
authorXavier Perseguers <xavier@typo3.org>
Thu, 30 Jul 2015 07:13:53 +0000 (09:13 +0200)
committerXavier Perseguers <xavier@typo3.org>
Thu, 30 Jul 2015 12:28:43 +0000 (14:28 +0200)
When updating extensions from TER, ll-XML are not properly
converted to XLIFF. This leads to empty labels in Pootle.

Change-Id: I797c2fe91f0f548b833fb724eae1d3b284fabc4a
Related: #68637
Reviewed-on: http://review.typo3.org/42128
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
typo3/files/scripts/bin/update-extension

index 9186f4d..62f462b 100755 (executable)
@@ -66,12 +66,14 @@ fi
 
 #
 # Extract t3x
+rm -rf ${EXTENSION}
 ${T3XUTILS} extract ${EXTENSION_T3X} ${EXTENSION} >/dev/null
 
 IFS=$(echo -en "\n\b")
 
 #
 # Create directory structure for templates
+rm -rf /tmp/TYPO3.ext.${EXTENSION}
 for FILE in $(find ${EXTENSION}/ -name \*.xml); do
        grep "T3locallang" "${FILE}" >/dev/null
        if [ $? -eq 0 ]; then
@@ -94,12 +96,10 @@ for FILE in $(find TYPO3.ext.${EXTENSION} -name \*.xml); do
                XLF_FILE=$(echo ${FILE} | sed s/.xml$/.xlf/)
                if [ ! -f ${XLF_FILE} ]; then
                        echo "[INFO]    Convert LLXML to XLIFF for file ${FILE}"
-                       if [ ! -f $XLF_FILE ]; then
-                               xsltproc --stringparam lang en \
-                                       --stringparam extension ${EXTENSION} \
-                                       --stringparam date "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" ${XSL_LLXML2TEMPLATE $FILE} | \
-                                       xmlstarlet ed --insert "/xliff/file/body/trans-unit" --type attr -n xml:space -v preserve > ${XLF_FILE}
-                       fi
+                       xsltproc --stringparam lang en \
+                               --stringparam extension ${EXTENSION} \
+                               --stringparam date "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" ${XSL_LLXML2TEMPLATE} ${FILE} | \
+                               xmlstarlet ed --insert "/xliff/file/body/trans-unit" --type attr -n xml:space -v preserve > ${XLF_FILE}
                fi
        fi
        rm -f ${FILE}