Project

General

Profile

Actions

Bug #78095

closed

Inconsistent behavior loading language labels when using Fluid VS Typoscript

Added by Klaus Hörmann-Engl about 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Localization
Target version:
-
Start date:
2016-09-28
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Inconsistent behavior loading language labels when using Fluid VS Typoscript

I encountered an inconsistent behavior when loading a language label from a xlf language file using TypoScript VS Fluid.

Presetting:

I use a language file "locallang.xlf" which has the "source-language" set to "de". Which means that I want to use German as default language. Furthermore I have an english translation file named "en.locallang.xlf", which has also set the "source-language" to "de". The "target-language" is set to "en".

locallang.xlf:

<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.0">
  <file source-language="de" datatype="plaintext" original="messages" date="2013-12-24T09:57:19Z" product-name="test_extension">
    <header/>
    <body>
      <trans-unit id="website.test">
        <source>Hallo Welt</source>
      </trans-unit>
    </body>
  </file>
</xliff>

en.locallang.xlf:

<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.0">
  <file source-language="de" target-language="en" datatype="plaintext" original="messages" date="2013-12-24T09:57:19Z" product-name="test_extension">
    <header/>
    <body>
      <trans-unit id="website.test">
        <source>Hallo Welt</source>
        <target>Hello world</target>
      </trans-unit>
    </body>
  </file>
</xliff>

Fluid:

In my Layout "Default.html" I use following code:

<f:translate key="website.test" />

Typoscript:

In my Typoscript file "libs.ts" I use this code:

lib.test = TEXT
lib.test {
  value.data = LLL:EXT:test_extension:/Resources/Private/Language/locallang.xlf:website.test
}

Frontend output:

Here I try to explain the various combinations in frontend output for the selected language as well as the used method (Fluid, TypoScript).

1. test:

Language: German
Method: Fluid
Expected output: Hallo Welt
Rendered output: Hallo Welt
Result: OK

2. test:

Language: German
Method: Typoscript
Expected output: Hallo Welt
Rendered output: Hallo Welt
Result: Seems OK, but Typoscript actually displays the fallback. There is no "de.locallang.xlf" therefore it falls back to "locallang.xlf" which is in this case German. So it seems OK, but actually it isn't.

3. test:

Language: English
Method: Fluid
Expected output: Hello world
Rendered output: Hello world
Result: OK

4. test:

Language: English
Method: Typoscript
Expected output: Hello world
Rendered output: Hallo Welt
Result: NOT OK, Typoscript just uses the "locallang.xlf" file, which contains "Hallo Welt", and does not render the text from "en.locallang.xlf"

Conclusion:

There is a inconsistent behavior when reading a language label using Typoscript VS Fluid. I would like to have Typoscript behave the same as FLUID, because I do not want to have my basic language file "locallang.xlf" in english, but rather in german.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #74380: TypoScript interpret XLF wrong for Default-Language (german) and englishClosed2016-03-06

Actions
Actions

Also available in: Atom PDF