Project

General

Profile

Actions

Bug #65273

closed

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

Added by Markus Klein about 9 years ago. Updated over 5 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

Also available in: Atom PDF