Bug #58960
closedLocalization overwrite with multiple plugins from the same extension
0%
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