[BUGFIX] 4.x locallang.xml are not available nor properly renamed 18/42118/2
authorXavier Perseguers <xavier@typo3.org>
Wed, 29 Jul 2015 19:49:13 +0000 (21:49 +0200)
committerXavier Perseguers <xavier@typo3.org>
Wed, 29 Jul 2015 19:52:43 +0000 (21:52 +0200)
Legacy 4.x localization files should be prefixed by target language
code and then converted as ll-XML if needed.

Change-Id: Ia5919b25e7ea2f9d94d6c1c37d6f440d45cd6961
Reviewed-on: http://review.typo3.org/42118
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
typo3/files/scripts/bin/build-language-pack
typo3/files/scripts/bin/build-sysext-language-pack

index c12fdae..e98061f 100755 (executable)
@@ -92,12 +92,12 @@ for EXTNAME in $EXTENSIONS; do
                                mv $XLF $DIR/$LANG.$FILE
 
                                # Convert XLIFF to LLXML
-                               _SOURCE_XLIFF_FILE=${POOTLE_PO}/$EXT_PREFIX.$EXTNAME/templates/$DIR/$FILE
-                               LLXML=$DIR/$LANG.$(echo $FILE | sed s/\.xlf$/\.xml/)
-                               llxml2xliff $EXTNAME \
-                                       $LANG \
-                                       $_SOURCE_XLIFF_FILE \
-                                       $DIR/$LANG.$FILE > $LLXML
+                               SOURCE_XLIFF_FILE=${POOTLE_PO}/$EXT_PREFIX.$EXTNAME/templates/$DIR/$FILE
+                               LLXML=${DIR}/${LANG}.$(echo $FILE | sed s/\.xlf$/\.xml/)
+                               llxml2xliff ${EXTNAME} \
+                                       ${LANG} \
+                                       ${SOURCE_XLIFF_FILE} \
+                                       ${DIR}/${LANG}.${FILE} > ${LLXML}
                        done
                        find . -name \*.xlf -exec chmod 644 {} \;
                        find . -name \*.xml -exec chmod 644 {} \;
index 2aeb52f..6097afe 100755 (executable)
@@ -110,7 +110,24 @@ for EXTNAME in $EXTENSIONS; do
                                        fi
                                        TARGET_FILE=$(grep $XLF ${MAPPING} | cut -d' ' -f2)
                                        if [ -z "${TARGET_FILE}" ]; then
-                                               # File does not exist for current TYPO3 version
+                                               echo $XLF | egrep -q '^locallang\.(.*)\.xlf$';
+                                               if [ $? -eq 0 ]; then
+                                                       # File does not exist for current TYPO3 version
+                                                       rm -f $XLF
+                                               else
+                                                       TRANSLATED_TARGET_FILE="$(dirname $XLF)/${LANG}.$(basename $XLF)"
+                                                       mv $XLF ${TRANSLATED_TARGET_FILE}
+
+                                                       if [ "${VERSION}" = 'v6' ]; then
+                                                               # Convert XLIFF to LLXML
+                                                               SOURCE_XLIFF_FILE=${POOTLE_PO}/${EXT_PREFIX}.${EXTNAME}/templates/$XML
+                                                               LLXML="$(echo ${TRANSLATED_TARGET_FILE} | sed s/\.xlf$/\.xml/)"
+                                                               llxml2xliff ${EXTNAME} \
+                                                                       ${LANG} \
+                                                                       ${SOURCE_XLIFF_FILE} \
+                                                                       ${TRANSLATED_TARGET_FILE} > ${LLXML}
+                                                       fi
+                                               fi
                                                continue
                                        fi
 
@@ -159,12 +176,12 @@ EOT
 
                                        if [ "${VERSION}" = 'v6' ]; then
                                                # Convert XLIFF to LLXML
-                                               _SOURCE_XLIFF_FILE=${POOTLE_PO}/${EXT_PREFIX}.${EXTNAME}/templates/${DIR}/${FILE}
+                                               SOURCE_XLIFF_FILE=${POOTLE_PO}/${EXT_PREFIX}.${EXTNAME}/templates/${DIR}/${FILE}
                                                LLXML="$(echo ${TRANSLATED_TARGET_FILE} | sed s/\.xlf$/\.xml/)"
-                                               llxml2xliff $EXTNAME \
-                                                       $LANG \
-                                                       $_SOURCE_XLIFF_FILE \
-                                                       ${TRANSLATED_TARGET_FILE} > $LLXML
+                                               llxml2xliff ${EXTNAME} \
+                                                       ${LANG} \
+                                                       ${SOURCE_XLIFF_FILE} \
+                                                       ${TRANSLATED_TARGET_FILE} > ${LLXML}
                                        fi
                                done
                                find . -name \*.xlf -exec chmod 644 {} \;