Bug #35093
closedLocalization in Typoscript via XLIFF
0%
Description
In Typoscript you can use the following snippet to localize a string:
10 = TEXT
10 {
value = {LLL:fileadmin/your_path/locallang.xml:your_label}
insertData = 1
}
This works since ages.
But if you want to use XLIFF it doesn't work:
10 = TEXT
10 {
value = {LLL:fileadmin/your_path/locallang.xlf:your_label}
insertData = 1
}
Only the default language is shown. The language in config.language is correct set. I have the two files "locallang.xlf" and "de.locallang.xlf" in this directory.
I recognized it in TYPO3 4.7beta2 but I think it will be also in TYPO3 4.6.
Updated by Viktor Livakivskyi almost 13 years ago
Confirm this - XLIFF localization broken in 4.6 as well.
Added related issue, which happens in fluid translate viewhelper.
Updated by Gerrit Code Review almost 12 years ago
- Status changed from Accepted to Under Review
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20133
Updated by Stefan Froemken almost 12 years ago
I have just added a patch for this, but in sourcecode you can read: "Absolute file reference to locallang-XML file. Must be inside system/global/local extension". So the idea of this method is to NOT have locallang files in fileadmin. My patch breaks this idea and makes it possible.
It's up to the core to decide if fileadmin can be a valid locallang directory. For all others who need this functionality: Have fun with this patch or still wait for a better solution by a core member.
Stefan
Updated by Michael Bakonyi almost 12 years ago
3 related bug-reports + 7 votes on fixing it - would be nice if someone could review the patch from Stefan. :)
Updated by Markus Klein almost 12 years ago
Please read my comment(s) in https://review.typo3.org/9535
Updated by Gerrit Code Review over 10 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34285
Updated by Markus Klein over 10 years ago
- Is Regression set to No
Detailed analysis¶
The thing is fairly complex.
First we have two different file types: xlf and xml
xml allows to have translations in the same file as the original, xlf does not allow this.
Translations from Pootle are always shipped in separate files per language.
- typo3conf/l10n/<lang>/
- <lang>.filename.xlf/xml in the same directory as the original file
- the original file itself (only with xml file type)
The current code is implemented like this¶
The LocallangXmlParser calls the llXmlAutoFileName() method only once (with $sameFile = FALSE) to cover the first check from above. If the file does not exist it falls back to check 3.
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.
- For XML files the second check is missing
- llXmlAutoFileName() with $sameFile = TRUE allows the split translation files only within some specific directories. This kills any translation requested from fileadmin.
- The first check is only necessary if the file is really coming from an extension, otherwise there is no translation in this folder
Updated by Gerrit Code Review over 10 years ago
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/34285
Updated by Gerrit Code Review over 10 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34285
Updated by Gerrit Code Review over 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/34285
Updated by Gerrit Code Review over 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/34285
Updated by Gerrit Code Review about 10 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34285
Updated by Markus Klein about 10 years ago
Patch was reverted and will be repushed.
Updated by Gerrit Code Review about 10 years ago
Patch set 1 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 Mathias Schreiber about 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 81ec05a3fc39845426f302412d53ef6480fc7c3a.
Updated by Markus Klein about 10 years ago
- Status changed from Resolved to Under Review
Updated by Markus Klein about 10 years ago
- Status changed from Under Review to Closed
- % Done changed from 100 to 0
Closing this as duplicate/related to #65273.
Please continue any discussion there.