Issue Bug Closed

#110006translateLabels() raises exception when label matches the pattern of a ll file reference

Philipp Thiele 06/05/26, 09:29 updated 06/05/26, 11:02

Description

In TYPO3 14 i have an IRRE configured field that renders title of the child record as usual.
However, when the content of the title field is something like “05.11.2021: a nice title” typo3 backend raises an exception when i open the record from list module:

> Core: Exception handler (WEB: BE): InvalidArgumentException, code #1760479988, file /var/www/html/vendor/typo3/cms-core/Classes/Localization/LabelFileResolver.php, line 59: Package with key “05” not found- InvalidArgumentException: Package with key “05” not found, in file /var/www/html/vendor/typo3/cms-core/Classes/Localization/LabelFileResolver.php:59

The reason is that 05.11.2021: matches the syntax for the language file resultion. i worked around by catching the exception of the call of $this->translate() in \TYPO3\CMS\Core\Localization\LanguageService and return input instead but i wonder if there is a better alternative:

$parts = explode(':', trim($restStr), 2);
        if (isset($parts[1])) {
            // Handle both domain references and file paths
            if ($extensionPrefix === '') {
                // This could be a domain reference (e.g., "core.tabs:general")
                // The file path resolution happens in LocalizationFactory
                $fileReference = $parts[0];
            } else {
                // Traditional EXT: file path
                $fileReference = $extensionPrefix . $parts[0];
            }
            try {
                $result = (string)$this->translate($parts[1], $fileReference);
            } catch(\Exception $e) {
                return $input;
            }

            if ($hasLLLPrefix) {
                return $result;
            }
            // If LLL: prefix was not used, we return the input as-is if no translation was found
            return $result !== '' ? $result : $input;

        }

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 2

  1. Garvin Hicking commented and changed status New Closed <span data-processor="relativetime" data-value="2026-06-05T11:02:11+00:00" > 06/05/26, 11:02 </span>

    I think this is the same as #109983 – there’s a WIP patch applied to it, maybe you’d like to weigh in?

    If I misread this issue please let me know and I’ll reopen.