Project

General

Profile

Actions

Bug #86194

closed

Translation fails if file locallang.xlf is not provided

Added by Georg Tiefenbrunn almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Extbase + l10n
Target version:
Start date:
2018-09-07
Due date:
% Done:

100%

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

Description

Prior to #82354 it was possible to define all language labels in plain TypoScript using plugin.tx_extkey._LOCAL_LANG without the need to define LLL in an XLIFF file.

As LocalizationUtility.php::loadTypoScriptLabels() now checks isset(self::$LOCAL_LANG[$languageFilePath][$languageKey]) translation using <f:translate /> and LocalizationUtility::translate() fails if the extension does not provide a locallang.xlf file.

Steps to reproduce:

Create an extension without a extkey/Resources/Private/Language/locallang.xlf file and define some LLL:

plugin.tx_extkey._LOCAL_LANG.default {
  test1 = Test 1
}

<f:translate key="test1" extensionName="extkey" default="###Default value for test1###" /> will output '###Default value for test1###'.

Workaround:

Create a extkey/Resources/Private/Language/locallang.xlf file and add at least one dummy entry (e.g. <trans-unit id="extKey"><source>extKey</source></trans-unit>). Now <f:translate key="test1" extensionName="extkey" default="#Test 1" /> will output 'Test 1'


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #82354: Add possibility to get a label in a specific language in LocalizationUtility::translate()ClosedMarkus Hölzle2017-09-07

Actions
Actions #1

Updated by Georg Tiefenbrunn almost 6 years ago

  • Related to Feature #82354: Add possibility to get a label in a specific language in LocalizationUtility::translate() added
Actions #2

Updated by Tymoteusz Motylewski almost 6 years ago

  • Assignee deleted (Tymoteusz Motylewski)
Actions #3

Updated by Markus Klein over 5 years ago

  • Status changed from New to Accepted
  • Priority changed from Should have to Must have
  • Target version set to 9 LTS
  • Is Regression set to Yes
Actions #4

Updated by Markus Klein over 5 years ago

This is a regression, even though I consider it a rare case.

Actions #5

Updated by Markus Klein over 5 years ago

  • Assignee set to Markus Klein
  • Complexity set to medium
Actions #6

Updated by Gerrit Code Review over 5 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58373

Actions #7

Updated by Markus Klein over 5 years ago

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

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF