Bug #34728
closed
llXmlAutoFilename will never find localized files in l10n path
Added by Thomas Layh over 12 years ago.
Updated over 9 years ago.
Description
If the parameter $sameLocation in function llXmlAutoFileName is set to false, like it is as default, it will never return a file name.
$location is set to "typo3conf/l10n" and since there is a condition missing, $validatePrefix will never get a path and then the function will always return NULL.
Adding another condition that checks for the l10n path resolves the problem.
Pushing a patch to review in a minute.
Files
- Status changed from New to Under Review
Update: Kind of confused tonight. It has nothing to do with the parameter $sameLocation, the problem is, if the parameter $fileRef contains a path to typo3conf/l10n the function will always return NULL.
Can you please describe your use case a bit further? When do you happen to have a file within typo3conf/l10n/ ?
I am calling the following from inside my xliff translation tool to get the parsed data:
$xliffParser = t3lib_div::makeInstance('t3lib_l10n_parser_Xliff');
$data = $xliffParser->getParsedData($fileRef, $languageKey);
and getParsedData is calling the llXmlAutoFileName function then.
Perhaps I am using the function for something it is not supposed to do, but I don't see a reason why.
After trying to recap, why I watched this issue in the first place, I post some test instructions to make the issue clear.
Copy the files from the attached ZIP into a current master installation.
Then install the testext in the Extension Manager.
Now place the following code in a TypoScript template:
config.language = de
page = PAGE
page.10 = TEXT
page.10.data = LLL:EXT:testext/Resources/Private/Language/locallang.xlf:mylabel
page.20 = TEXT
page.20.data = LLL:fileadmin/translation/locallang.xlf:mylabel2
You will see that the first label ist translated correctly to German but the second example stays English.
I think you could do a simple cleanup in GeneralUtility::llXmlAutoFileName()
to solve this issue.
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
Find an analysis of mine in #35093.
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
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
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
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
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
Patch was reverted and will be repushed.
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
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Under Review
- 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.
Also available in: Atom
PDF