Commit 8b3e2d7b authored by Georg Ringer's avatar Georg Ringer
Browse files

[TASK] Update XLIFF version to 1.2

Update all XLIFF files to use version 1.2, which makes it possible to
use a validation schema.

Also drop the TYPO3-specific XLIFF file IDs (together with the reference
to the corresponding XML namespace) as those are not needed anymore,
but prevented XML validation.

Also drop checking the XLIFF file IDs from the CI jobs as this
does not make sense anymore now.

This change does not fix the discovered validation errors in the XLIFF
files. This will come later in a separate change.

Resolves: #93594
Releases: master, 10.4
Change-Id: I1f263b0a5a7f170e90a906d7992d7bbf08503f7d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/68169


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent f8e4b443
......@@ -104,7 +104,6 @@ Options:
- checkGruntClean: Verify "grunt build" is clean. Warning: Executes git commands! Usually used in CI only.
- checkPermissions: test some core files for correct executable bits
- checkRst: test .rst files for integrity
- checkXlf: test .xlf files for integrity
- composerInstall: "composer install"
- composerInstallMax: "composer update", with no platform.php config.
- composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0.
......@@ -539,12 +538,6 @@ case ${TEST_SUITE} in
SUITE_EXIT_CODE=$?
docker-compose down
;;
checkXlf)
setUpDockerComposeDotEnv
docker-compose run check_xlf
SUITE_EXIT_CODE=$?
docker-compose down
;;
composerInstall)
setUpDockerComposeDotEnv
docker-compose run composer_install
......
#!/bin/bash
#########################
#
# Find all xmlns:t3 namespace definition and
# t3:id numbers in XLF language files
# and check their uniqueness.
#
# It expects to be run from the core root.
#
##########################
XLF_FILES="xlffiles.txt"
XLF_IDS="xlfids.txt"
XLF_XMLNS="xlfxmlns.txt"
function join { local IFS="$1"; shift; echo "$*"; }
echo 'Collecting XLF files'
find typo3/ -name '*.xlf' > $XLF_FILES
XLFCNT=$(cat xlffiles.txt | wc -l)
# Check for xmlns
echo 'Extracting xmlns:t3 information'
sed -ne 's/.*\(xmlns:t3="http:\/\/typo3.org\/schemas\/xliff"\)/\1/pg' `cat $XLF_FILES` | sort > $XLF_XMLNS
XLFXMLNSCNT=$(cat $XLF_XMLNS | wc -l)
DIFFXMLNS=$(join , $(uniq -d $XLF_XMLNS))
MISSINGXMLNS=$(join , $(grep -L 'xmlns:t3="http://typo3.org/schemas/xliff"' `cat $XLF_FILES`))
# Checks for t3:id
echo 'Extracting t3:id information'
sed -ne 's/.*t3:id="\([0-9]\+\)".*/\1/pg' `cat $XLF_FILES` | sort > $XLF_IDS
echo 'Processing ids'
XLFIDCNT=$(cat $XLF_IDS | wc -l)
UXLFIDCNT=$(uniq $XLF_IDS | wc -l)
DIFFIDS=$(join , $(uniq -d $XLF_IDS))
MISSINGIDS=$(join , $(grep -L 't3:id' `cat $XLF_FILES`))
# Cleanup of temporary files
rm $XLF_IDS $XLF_FILES $XLF_XMLNS
if [ $XLFCNT -ne $XLFXMLNSCNT ];
then
echo "There is at least one XLF file missing a xmlns for t3 (xmlns:t3)."
echo "Missing in: $MISSINGXMLNS"
exit 1
fi
if [ $XLFCNT -ne $XLFIDCNT ];
then
echo "There is at least one XLF file missing a unique ID (t3:id)."
echo "Missing in: $MISSINGIDS"
exit 1
fi
if [ $XLFIDCNT -ne $UXLFIDCNT ];
then
echo "There is an XLF id that does not seem to be UNIQUE."
echo "Search for t3:id $DIFFIDS"
exit 1
fi
exit 0
......@@ -1058,13 +1058,6 @@ abstract class AbstractCoreSpec {
this.getScriptTaskBashInlineBody() +
"./Build/Scripts/checkFilePermissions.sh\n"
),
new ScriptTask()
.description("Run xlf check")
.interpreter(ScriptTaskProperties.Interpreter.BINSH_OR_CMDEXE)
.inlineBody(
this.getScriptTaskBashInlineBody() +
"./Build/Scripts/xlfcheck.sh"
),
new ScriptTask()
.description("Run rst check")
.interpreter(ScriptTaskProperties.Interpreter.BINSH_OR_CMDEXE)
......
......@@ -52,7 +52,6 @@ integration various php 7.4:
# @todo: try to set up gitlab with FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR and have a non-root user setup for containers
# @todo: or relax the test script a bit
# - Build/Scripts/runTests.sh -s checkPermissions -p 7.4
- Build/Scripts/runTests.sh -s checkXlf -p 7.4
- Build/Scripts/runTests.sh -s checkRst -p 7.4
- Build/Scripts/runTests.sh -s checkFilePathLength -p 7.4
- Build/Scripts/runTests.sh -s checkExtensionScannerRst -p 7.4
......
......@@ -45,7 +45,6 @@ integration various php 7.4 pre-merge:
# @todo: try to set up gitlab with FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR and have a non-root user setup for containers
# @todo: or relax the test script a bit
# - Build/Scripts/runTests.sh -s checkPermissions -p 7.4
- Build/Scripts/runTests.sh -s checkXlf -p 7.4
- Build/Scripts/runTests.sh -s checkRst -p 7.4
- Build/Scripts/runTests.sh -s checkFilePathLength -p 7.4
- Build/Scripts/runTests.sh -s checkExtensionScannerRst -p 7.4
......
......@@ -705,23 +705,6 @@ services:
php -dxdebug.mode=off Build/Scripts/validateRstFiles.php;
"
check_xlf:
image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
user: ${HOST_UID}
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- ${PASSWD_PATH}:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
/bin/sh -c "
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
set -x
fi
Build/Scripts/xlfcheck.sh;
"
composer_install:
image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
user: ${HOST_UID}
......
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1520838123" source-language="en" datatype="plaintext" original="EXT:adminpanel/Resources/Private/Language/locallang.xlf" date="2018-03-31T08:08:00Z"
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="EXT:adminpanel/Resources/Private/Language/locallang.xlf" date="2018-03-31T08:08:00Z"
product-name="adminpanel">
<header/>
<body>
......
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1520862804" source-language="en" datatype="plaintext" original="EXT:adminpanel/Resources/Private/Language/locallang_cache.xlf" date="2018-03-12T13:52:00Z"
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="EXT:adminpanel/Resources/Private/Language/locallang_cache.xlf" date="2018-03-12T13:52:00Z"
product-name="adminpanel">
<header/>
<body>
......
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1521629231" source-language="en" datatype="plaintext" original="EXT:adminpanel/Resources/Private/Language/locallang_debug.xlf" date="2018-03-21T11:47:00Z"
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="EXT:adminpanel/Resources/Private/Language/locallang_debug.xlf" date="2018-03-21T11:47:00Z"
product-name="adminpanel">
<header/>
<body>
......
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1520862805" source-language="en" datatype="plaintext" original="EXT:adminpanel/Resources/Private/Language/locallang_info.xlf" date="2018-03-12T13:52:01Z" product-name="adminpanel">
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="EXT:adminpanel/Resources/Private/Language/locallang_info.xlf" date="2018-03-12T13:52:01Z" product-name="adminpanel">
<header/>
<body>
<trans-unit id="module.label" resname="module.label">
......
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1520838433" source-language="en" datatype="plaintext" original="EXT:adminpanel/Resources/Private/Language/locallang_preview.xlf" date="2018-03-13T08:08:00Z"
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="EXT:adminpanel/Resources/Private/Language/locallang_preview.xlf" date="2018-03-13T08:08:00Z"
product-name="adminpanel">
<header/>
......
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1521103145" source-language="en" datatype="plaintext" original="EXT:adminpanel/Resources/Private/Language/locallang_tsdebug.xlf" date="2018-03-15T09:39:00Z" product-name="adminpanel">
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="EXT:adminpanel/Resources/Private/Language/locallang_tsdebug.xlf" date="2018-03-15T09:39:00Z" product-name="adminpanel">
<header/>
<body>
<trans-unit id="module.label" resname="module.label">
......
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1415814871" source-language="en" datatype="plaintext" original="EXT:backend/Resources/Private/Language/Modules/about.xlf" date="2011-10-17T20:22:34Z" product-name="typo3-cms-backend">
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="EXT:backend/Resources/Private/Language/Modules/about.xlf" date="2011-10-17T20:22:34Z" product-name="typo3-cms-backend">
<header/>
<body>
<trans-unit id="mlang_labels_tablabel" resname="mlang_labels_tablabel">
......
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1415814848" source-language="en" datatype="plaintext" original="EXT:backend/Resources/Private/Language/Modules/locallang_alt_intro.xlf" date="2011-10-17T20:22:33Z" product-name="lang">
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="EXT:backend/Resources/Private/Language/Modules/locallang_alt_intro.xlf" date="2011-10-17T20:22:33Z" product-name="lang">
<header/>
<body>
</body>
......
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1420197366" source-language="en" datatype="plaintext" original="EXT:backend/Resources/Private/Language/locallang.xlf" date="2015-01-02T11:16:11Z" product-name="backend">
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="EXT:backend/Resources/Private/Language/locallang.xlf" date="2015-01-02T11:16:11Z" product-name="backend">
<header/>
<body>
<trans-unit id="no_modules_registered" resname="no_modules_registered">
......
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1415814847" source-language="en" datatype="plaintext" original="EXT:backend/Resources/Private/Language/locallang_alt_doc.xlf" date="2011-10-17T20:22:33Z" product-name="lang">
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="EXT:backend/Resources/Private/Language/locallang_alt_doc.xlf" date="2011-10-17T20:22:33Z" product-name="lang">
<header/>
<body>
<trans-unit id="deleteItem" resname="deleteItem">
......
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1415814786" source-language="en" datatype="plaintext" original="EXT:backend/Resources/Private/Language/locallang_db_new_content_el.xlf" date="2011-10-17T20:22:32Z" product-name="cms">
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="EXT:backend/Resources/Private/Language/locallang_db_new_content_el.xlf" date="2011-10-17T20:22:32Z" product-name="cms">
<header/>
<body>
<trans-unit id="sel1" resname="sel1">
......
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1415814785" source-language="en" datatype="plaintext" original="EXT:backend/Resources/Private/Language/locallang_layout.xlf" date="2011-10-17T20:22:32Z" product-name="cms">
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="EXT:backend/Resources/Private/Language/locallang_layout.xlf" date="2011-10-17T20:22:32Z" product-name="cms">
<header/>
<body>
<trans-unit id="title" resname="title">
......
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1415814864" source-language="en" datatype="plaintext" original="EXT:backend/Resources/Private/Language/locallang_login.xlf" date="2011-10-17T20:22:34Z" product-name="lang">
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="EXT:backend/Resources/Private/Language/locallang_login.xlf" date="2011-10-17T20:22:34Z" product-name="lang">
<header/>
<body>
<trans-unit id="labels.submitLogout" resname="labels.submitLogout">
......
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1611662325" source-language="en" datatype="plaintext" original="EXT:backend/Resources/Private/Language/locallang_mfa.xlf" date="2021-01-26T11:58:45Z" product-name="cms">
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="EXT:backend/Resources/Private/Language/locallang_mfa.xlf" date="2021-01-26T11:58:45Z" product-name="cms">
<header/>
<body>
<trans-unit id="overview.title" resname="overview.title">
......
Supports Markdown
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