Project

General

Profile

Actions

Bug #58960

closed

Localization overwrite with multiple plugins from the same extension

Added by Nils Blattner almost 10 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase + l10n
Target version:
-
Start date:
2014-05-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.1
PHP Version:
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

Description

When using Tx_Extbase_Utility_Localization::translate() in conjunction with several plugins of the same extension on the same page, overwriting the labels with plugin.tx_myext._LOCAL_LANG and plugin.tx_myext_piX._LOCAL_LANG yields strange results.

Assume two plugins myext_pi1 and myext_pi2 which share some actions (and templates with <f:translate />-ViewHelpers) on the same page. The default translation in Resources/Private/Language/locallang.xml would be Testtitel 1.

<h2><f:translate key="header" /></h2>

Now if you want to overwrite the header just for myext_pi2, you would assume that you can use plugin.tx_myext_pi2._LOCAL_LANG.de.header = Testtitel 2

However, the result now depends on which plugin is rendered first:

The result if myext_pi1 is rendered first:

Testtitel 1
Testtitel 1

If myext_pi2 is rendered first:

Testtitel 2
Testtitel 2

The reason behind this is, that Tx_Extbase_Utility_Localization caches the labels on a per call base by extension (self::$LOCAL_LANG[$extensionName], line 137) and loads the TypoScript-labels by plugin ($configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK), line 188).
=> Tx_Extbase_Configuration_FrontendConfigurationManager::getPluginConfiguration() includes the TS of plugin.tx_myext_piX (line 59)

As far as I can see, this issue is still persistent in TYPO3 6.2, as those two functions changed only semantically but not in the way they work.

Obviously this is not an everyday case, however if you want to span an application over multiple content columns, this can occur and is cumbersome to debug.

Cheers Nils


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #100759: f:translate does not take overrides of labels in TypoScript into account anymoreResolved2023-04-26

Actions
Related to TYPO3 Core - Task #99559: Allow to override labels in LanguageServiceClosedBenni Mack2023-01-16

Actions
Actions

Also available in: Atom PDF