Commit 51d53a9e authored by Xavier Perseguers's avatar Xavier Perseguers
Browse files

[BUGFIX] 4.x locallang.xml are not available nor properly renamed

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's avatarXavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers's avatarXavier Perseguers <xavier@typo3.org>
parent b0086f93
......@@ -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 {} \;
......
......@@ -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 {} \;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment