Project

General

Profile

Actions

Bug #65273

closed

Using XLIFF translation files located in non-extension folders does not work

Added by Markus Klein over 9 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Localization
Target version:
Start date:
2015-02-24
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Yes
Sprint Focus:

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

locallang.tgz (733 Bytes) locallang.tgz Example locallang files Markus Klein, 2015-02-24 16:36

Related issues 3 (0 open3 closed)

Is duplicate of TYPO3 Core - Bug #34728: llXmlAutoFilename will never find localized files in l10n pathClosed2012-03-10

Actions
Is duplicate of TYPO3 Core - Bug #35093: Localization in Typoscript via XLIFFClosed2012-03-21

Actions
Is duplicate of TYPO3 Core - Feature #47172: Permit custom locations for localization files (XLIFF file handling in llXmlAutoFileName)Closed2013-04-12

Actions
Actions #1

Updated by Markus Klein over 9 years ago

  • Status changed from Accepted to Closed

Closing this as duplicate/related to #65273.
Please continue any discussion there.

Actions #2

Updated by Peter Kraume over 9 years ago

I think there went something wrong. You just closed #65273 as well ;)

Actions #3

Updated by Markus Klein over 9 years ago

  • Category changed from Backend API to Localization
  • Status changed from Closed to Accepted
  • Complexity changed from hard to medium

Indeed... ;-)

Actions #4

Updated by Gerrit Code Review over 9 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

Actions #5

Updated by Markus Klein over 9 years ago

  • Description updated (diff)
Actions #6

Updated by Gerrit Code Review over 9 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

Actions #7

Updated by Gerrit Code Review over 9 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

Actions #8

Updated by Markus Klein over 9 years ago

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

Updated by Gerrit Code Review over 9 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

Actions #10

Updated by Gerrit Code Review over 9 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

Actions #11

Updated by Markus Klein over 9 years ago

  • Status changed from Under Review to Resolved
Actions #12

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF