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
Updated by Markus Klein almost 10 years ago
- Project changed from 534 to TYPO3 Core
- Category deleted (
Extbase: - Language)
Updated by Markus Klein almost 10 years ago
- Category set to Extbase
- Status changed from New to Accepted
- Complexity set to medium
- Is Regression set to No
- TYPO3 Version set to 6.1
Thanks for finding this out. I guess we have to refine the caching to include the plugin as well.
Updated by Alexander Opitz over 7 years ago
- Status changed from Accepted to Needs Feedback
Hi,
as this issue is very old. Does the problem still exists within newer versions of TYPO3 CMS (6.2.28 or 7.6.12)?
Updated by Markus Klein over 7 years ago
- Status changed from Needs Feedback to Accepted
Still a valid bug!
Updated by Riccardo De Contardi over 6 years ago
- Category changed from Extbase to Extbase + l10n
Updated by Christian Kuhn 8 months ago
- Related to Bug #100759: f:translate does not take overrides of labels in TypoScript into account anymore added
Updated by Christian Kuhn 8 months ago
- Status changed from Accepted to Needs Feedback
Hmm. I'm kinda confident this issue has been resolved with the patch of #99559 - that static cache property is gone and other cache layers are at slightly different layers, now. Could we re-check this issue in v12?
Updated by Christian Kuhn 8 months ago
- Related to Task #99559: Allow to override labels in LanguageService added
Updated by Christian Kuhn 4 months ago
- Status changed from Needs Feedback to Closed
Closing here since we think this resolved meanwhile. Feel free to re-open, or create a fresh issue linking this one in case we missed something.