Bug #65273
closedUsing XLIFF translation files located in non-extension folders does not work
100%
Description
This is a summary ticket of multiple bug reports.
The problem¶
Setup¶
Consider a those files in /fileadmin:- locallang.xlf
- de.locallang.xlf
- locallangSplit.xml
- de.locallangSplit.xml
- locallangCombined.xml
Both contain a label named "myLabel".
Consider this TypoScript:
config.language = de page = PAGE page.100 = TEXT page.100.data = LLL:fileadmin/locallang.xlf:myLabel page.100.wrap = <p>|</p> page.200 = TEXT page.200.data = LLL:fileadmin/locallangSplit.xml:myLabel page.200.wrap = <p>|</p> page.210 = TEXT page.210.data = LLL:fileadmin/locallangCombined.xml:myLabel page.210.wrap = <p>|</p>
Current result¶
In FE the English label value will be displayed for XLIFF files.
Expected result¶
In FE the German label value shall be visible.
Analysis¶
Version 6.2+ are confirmed to be affected.
Background¶
The problem does not occur if the file is placed in any of these folders:- typo3/sysext/
- typo3/ext/
- typo3conf/ext/
- typo3conf/l10n/
- tests/
(This restriction stems from \TYPO3\CMS\Core\Utility\GeneralUtility::llXmlAutoFileName())
XML works¶
Using XML instead of XLIFF files solves the problem. Both types of XML files work:- All languages in one file
- Separate files for each language (when proper references are placed in the default language file:
<languageKey index="de">fileadmin/de.locallangSplit.xml</languageKey>
)
This is due to the fact that searching for the split-files happens implicitly in the xml-parser, which is not the case in the xlf-parser.
The XliffParser uses the default implementation in AbstractXmlParser which calls the llXmlAutoFileName() method twice. First with $sameFile = FALSE and then $sameFile = TRUE, so it covers all cases properly.
The only problem remaining therefore is:
llXmlAutoFileName() with $sameFile = TRUE allows the split translation files only within some specific directories. This kills any translation requested from fileadmin.
(Keep in mind to clear the SYSTEM cache whenever you change language files.)
Files
Updated by Markus Klein almost 10 years ago
- Status changed from Accepted to Closed
Closing this as duplicate/related to #65273.
Please continue any discussion there.
Updated by Peter Kraume almost 10 years ago
I think there went something wrong. You just closed #65273 as well ;)
Updated by Markus Klein almost 10 years ago
- Category changed from Backend API to Localization
- Status changed from Closed to Accepted
- Complexity changed from hard to medium
Indeed... ;-)
Updated by Gerrit Code Review almost 10 years ago
- Status changed from Accepted to Under Review
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37167
Updated by Gerrit Code Review almost 10 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37167
Updated by Gerrit Code Review almost 10 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37167
Updated by Markus Klein almost 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 7fdfdff85cfab2b5174a1117530bcc3ae7be7301.
Updated by Gerrit Code Review almost 10 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37475
Updated by Gerrit Code Review almost 10 years ago
Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37475
Updated by Markus Klein almost 10 years ago
- Status changed from Under Review to Resolved
Applied in changeset 64cf5ee55fd92a63f2d2280918f4c6ca02ce6178.