Bug #86194
closedTranslation fails if file locallang.xlf is not provided
100%
Description
Prior to #82354 it was possible to define all language labels in plain TypoScript using plugin.tx_extkey._LOCAL_LANG
without the need to define LLL in an XLIFF file.
As LocalizationUtility.php::loadTypoScriptLabels()
now checks isset(self::$LOCAL_LANG[$languageFilePath][$languageKey])
translation using <f:translate />
and LocalizationUtility::translate()
fails if the extension does not provide a locallang.xlf file.
Steps to reproduce:
Create an extension without a extkey/Resources/Private/Language/locallang.xlf file and define some LLL:
plugin.tx_extkey._LOCAL_LANG.default { test1 = Test 1 }
<f:translate key="test1" extensionName="extkey" default="###Default value for test1###" />
will output '###Default value for test1###'.
Workaround:
Create a extkey/Resources/Private/Language/locallang.xlf file and add at least one dummy entry (e.g. <trans-unit id="extKey"><source>extKey</source></trans-unit>
). Now <f:translate key="test1" extensionName="extkey" default="#Test 1" />
will output 'Test 1'
Updated by Georg Tiefenbrunn over 5 years ago
- Related to Feature #82354: Add possibility to get a label in a specific language in LocalizationUtility::translate() added
Updated by Tymoteusz Motylewski over 5 years ago
- Assignee deleted (
Tymoteusz Motylewski)
Updated by Markus Klein over 5 years ago
- Status changed from New to Accepted
- Priority changed from Should have to Must have
- Target version set to 9 LTS
- Is Regression set to Yes
Updated by Markus Klein over 5 years ago
This is a regression, even though I consider it a rare case.
Updated by Markus Klein over 5 years ago
- Assignee set to Markus Klein
- Complexity set to medium
Updated by Gerrit Code Review over 5 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58373
Updated by Markus Klein over 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 959a5b8a84b32705960a3fbbe99724f17dc30056.