Bug #34728

llXmlAutoFilename will never find localized files in l10n path

Added by Thomas Layh over 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-03-10
Due date:
% Done:

0%

TYPO3 Version:
4.7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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.

languagetest.zip (4.2 KB) Alexander Stehlik, 2014-11-17 21:59


Related issues

Duplicated by TYPO3 Core - Bug #65273: Using XLIFF translation files located in non-extension folders does not work Closed 2015-02-24

Associated revisions

Revision 81ec05a3 (diff)
Added by Mathias Schreiber over 5 years ago

[BUGFIX] Properly handle translation file detection

The GeneralUtility::llXmlAutoFileName() method will now also correctly
handle paths to files that are not placed within a known directory (ext,
sysext, test etc.) if the call is made with $sameFile = TRUE.

This allows placing language files in storages like fileadmin.

Resolves: #35093
Resolves: #34728
Releases: master, 6.2
Change-Id: Ic5901c3fa98233978abf26db377666dade16f8e6
Reviewed-on: http://review.typo3.org/34285
Reviewed-by: Gernot Ploiner <>
Tested-by: Gernot Ploiner <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

History

#1 Updated by Gerrit Code Review over 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9535

#2 Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9535

#3 Updated by Thomas Layh over 8 years ago

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.

#4 Updated by Xavier Perseguers over 8 years ago

Can you please describe your use case a bit further? When do you happen to have a file within typo3conf/l10n/ ?

#5 Updated by Thomas Layh over 8 years ago

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.

#6 Updated by Gerrit Code Review over 7 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/9535

#7 Updated by Alexander Stehlik almost 6 years ago

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.

#8 Updated by Gerrit Code Review almost 6 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

#9 Updated by Markus Klein almost 6 years ago

  • Is Regression set to No

Find an analysis of mine in #35093.

#10 Updated by Gerrit Code Review almost 6 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

#11 Updated by Gerrit Code Review almost 6 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

#12 Updated by Gerrit Code Review almost 6 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

#13 Updated by Gerrit Code Review almost 6 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

#14 Updated by Gerrit Code Review over 5 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

#15 Updated by Markus Klein over 5 years ago

Patch was reverted and will be repushed.

#16 Updated by Gerrit Code Review over 5 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

#17 Updated by Mathias Schreiber over 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#18 Updated by Markus Klein over 5 years ago

  • Status changed from Resolved to Under Review

#19 Updated by Markus Klein over 5 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.

Also available in: Atom PDF