[BUGFIX] Allow access to TypoScript overrides for labels in _LOCAL_LANG
This bugfix enables the possibility to access _LOCAL_LANG values from TypoScript properly again via Extbase's LocalizationUtility, and thus for <f:translate> ViewHelpers as well again. This is what has changed under-the-hood: The TranslateViewHelper is now only a thin layer to Extbase's LocalizationUtility (as before), and only checks if a current request or Locale/languageKey is given, if a locale can be resolved. Everything else is then dispatched to the LocalizationUtility. <f:translate> is very clean now and has almost no further responsibility than to call LocalizationUtility::translate Instead of adding further LocalizationUtility magic, overriding of TypoScript is now enabled for any kind of plugin which hands in $extensionName. This is achieved by building proper Locale objects from the request which are then used to build the respective LanguageService. As it turned out after the 12.4.0 release, the "Locales" class is indeed the factory for creating a Locale, which is decoupled from the actual LanguageService (= label magic), the Locales factory receives a few create methods to make life easier for usage, which both f:translate AND LocalizationUtility receive, making their parts much smaller. Further work will disolve the usage of the Configuration Manager of Extbase, but this won't happen in v12 anymore. Resolves: #100759 Releases: main, 12.4 Change-Id: Ifcad2ec590746e96066a96f314500bd50e9b4695 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80732 Tested-by:Anja Leichsenring <aleichsenring@ab-softlab.de> Tested-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Anja Leichsenring <aleichsenring@ab-softlab.de> Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Benni Mack <benni@typo3.org>
Showing
- composer.json 1 addition, 0 deletionscomposer.json
- typo3/sysext/core/Classes/Localization/LanguageServiceFactory.php 1 addition, 4 deletions...sext/core/Classes/Localization/LanguageServiceFactory.php
- typo3/sysext/core/Classes/Localization/Locales.php 24 additions, 0 deletionstypo3/sysext/core/Classes/Localization/Locales.php
- typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php 22 additions, 41 deletionstypo3/sysext/extbase/Classes/Utility/LocalizationUtility.php
- typo3/sysext/extbase/Tests/Functional/Utility/LocalizationUtilityTest.php 12 additions, 1 deletion...base/Tests/Functional/Utility/LocalizationUtilityTest.php
- typo3/sysext/fluid/Classes/ViewHelpers/TranslateViewHelper.php 40 additions, 55 deletions.../sysext/fluid/Classes/ViewHelpers/TranslateViewHelper.php
- typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/test_translate/Classes/Controller/TranslateController.php 29 additions, 0 deletions...test_translate/Classes/Controller/TranslateController.php
- typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/test_translate/Configuration/Services.yaml 8 additions, 0 deletions...res/Extensions/test_translate/Configuration/Services.yaml
- typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/test_translate/Resources/Private/Templates/Translate.html 8 additions, 0 deletions...test_translate/Resources/Private/Templates/Translate.html
- typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/test_translate/composer.json 5 additions, 0 deletions...nctional/Fixtures/Extensions/test_translate/composer.json
- typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/test_translate/ext_localconf.php 18 additions, 0 deletions...onal/Fixtures/Extensions/test_translate/ext_localconf.php
- typo3/sysext/fluid/Tests/Functional/Fixtures/pages.csv 10 additions, 9 deletionstypo3/sysext/fluid/Tests/Functional/Fixtures/pages.csv
- typo3/sysext/fluid/Tests/Functional/ViewHelpers/TranslateViewHelperTest.php 72 additions, 0 deletions.../Tests/Functional/ViewHelpers/TranslateViewHelperTest.php
Please register or sign in to comment