Bug #86194

Translation fails if file locallang.xlf is not provided

Added by Georg Tiefenbrunn 9 months ago. Updated 8 months ago.

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

100%

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

Related to TYPO3 Core - Feature #82354: Add possibility to get a label in a specific language in LocalizationUtility::translate() Closed 2017-09-07

Associated revisions

Revision 959a5b8a (diff)
Added by Markus Klein 8 months ago

[BUGFIX] Allow settings language labels via TS even if no xlf present

Re-establish the functionality to set language labels in TypoScript
even though no locallang.xlf file is present for the given extension.

Resolves: #86194
Releases: master
Change-Id: Ifcd31909fa594be892f93c1037941313011b74cf
Reviewed-on: https://review.typo3.org/58373
Tested-by: TYPO3com <>
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>
Reviewed-by: Josef Glatz <>
Tested-by: Josef Glatz <>
Reviewed-by: Georg Tiefenbrunn <>
Tested-by: Georg Tiefenbrunn <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

History

#1 Updated by Georg Tiefenbrunn 9 months ago

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

#2 Updated by Tymoteusz Motylewski 9 months ago

  • Assignee deleted (Tymoteusz Motylewski)

#3 Updated by Markus Klein 8 months 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

#4 Updated by Markus Klein 8 months ago

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

#5 Updated by Markus Klein 8 months ago

  • Assignee set to Markus Klein
  • Complexity set to medium

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

#7 Updated by Markus Klein 8 months ago

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

#8 Updated by Benni Mack 8 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF