91066[FEATURE] Use translation domain mappings over LLL as simplified labels
Commit message
Review
-
Code review CR +2 Done
- Benjamin Kott +2
- Georg Ringer +1
- Garvin Hicking +1
-
Verified V +2 Done
- Benjamin Kott +2
- Georg Ringer +1
- Garvin Hicking +1
- core-ci +1 CI
Issues 1
Files 42
- typo3/sysext/backend/Classes/Controller/RecordListController.php2+1 −1
- typo3/sysext/backend/Classes/View/PageLayoutContext.php+1 −1
- typo3/sysext/core/Classes/Command/TranslationDomainListCommand.phpnew+147 −0
- typo3/sysext/core/Classes/Localization/Event/BeforeLabelResourceResolvedEvent.php2new+34 −0
- typo3/sysext/core/Classes/Localization/CacheWarmer.php+5 −14
- typo3/sysext/core/Classes/Localization/LabelFileResolver.php+92 −4
- typo3/sysext/core/Classes/Localization/LanguageService.php+38 −11
- typo3/sysext/core/Classes/Localization/LocalizationFactory.php+33 −28
- typo3/sysext/core/Classes/Localization/TranslationDomainMapper.phpnew+362 −0
- typo3/sysext/core/Classes/ServiceProvider.php+12 −0
- typo3/sysext/core/Configuration/Services.yaml5+7 −0
- typo3/sysext/core/Documentation/Changelog/14.0/Feature-93334-TranslationDomainMapping.rstnew+264 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_label_alias/Classes/EventListener/TranslationDomainAliasListener.phpnew+41 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_label_alias/Configuration/Services.yamlnew+8 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_label_alias/Resources/Private/Language/wizards.xlfnew+14 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_label_alias/composer.jsonnew+19 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_label_alias/ext_emconf.phpnew+17 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_translation_domain/Configuration/Sets/TestSet/labels.xlfnew+11 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_translation_domain/Resources/Private/Language/Form/locallang_tabs.xlfnew+11 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_translation_domain/Resources/Private/Language/SudoMode/locallang.xlfnew+11 −0
Show 22 more files
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_translation_domain/Resources/Private/Language/de.locallang.xlfnew+12 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_translation_domain/Resources/Private/Language/locallang.xlfnew+11 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_translation_domain/Resources/Private/Language/locallang_sudo_mode.xlfnew+11 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_translation_domain/Resources/Private/Language/locallang_tabs.xlfnew+11 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_translation_domain/Resources/Private/Language/locallang_toolbar.xlfnew+11 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_translation_domain/Resources/Private/Language/messages.xlfnew+11 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_translation_domain/Resources/Private/Language/tabs.xlfnew+11 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_translation_domain/composer.jsonnew+14 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_translation_domain/ext_emconf.phpnew+17 −0
- typo3/sysext/core/Tests/Functional/Localization/TranslationDomainAliasTest.phpnew+176 −0
- typo3/sysext/core/Tests/Functional/Localization/TranslationDomainMapperTest.phpnew+539 −0
- typo3/sysext/core/Tests/Unit/Localization/LocalizationFactoryTest.php+25 −14
- typo3/sysext/core/Tests/Unit/Page/PageRendererFactoryTrait.php+6 −1
- typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php2+1 −1
- typo3/sysext/form/Tests/Functional/Mvc/Validation/CountValidatorTest.php+4 −0
- typo3/sysext/form/Tests/Functional/Mvc/Validation/DateRangeValidatorTest.php+4 −0
- typo3/sysext/form/Tests/Functional/Mvc/Validation/EmptyValidatorTest.php+4 −0
- typo3/sysext/form/Tests/Functional/Mvc/Validation/FileSizeValidatorTest.php+4 −0
- typo3/sysext/lowlevel/Classes/ConfigurationModuleProvider/TranslationDomainListProvider.phpnew+79 −0
- typo3/sysext/lowlevel/Configuration/Services.yaml+8 −0
- typo3/sysext/lowlevel/Resources/Private/Language/locallang.xlf+3 −0
- composer.json+1 −0
Review log 6087
Show 4662 earlier messages
-
Benni Mack uploaded patch set 1 10/14/25, 22:58
-
core-ci voted on patch set 1 V -1 10/14/25, 23:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86662
-
Garvin Hicking uploaded patch set 2
V -110/15/25, 06:29 -
Garvin Hicking uploaded patch set 3 10/15/25, 06:31
-
Garvin Hicking commented on patch set 3 V -1 10/15/25, 06:40
My backend no longer works with this, I get an exception like this when calling "Web > List" or "Web > Page": ``` (1/1) #1729000001 InvalidArgumentException File path must start with "EXT:" at TYPO3\CMS\Core\Localization\LabelDomainMapper->extractExtensionKey('vendor/typo3/cms-backend/Resources/Private/Language/SudoMode.xlf') ``` Somehow a `vendor/` lands up in my resolved file name? I am using monorepo with composer wrapper (Jochen Roths TDK), that must surely affect this and would need addressing. Stacktrace: https://gist.github.com/garvinhicking/64a75a9ae63184df7a9aa45eea4042ea -
core-ci voted on patch set 3 V -1 10/15/25, 06:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86678
-
Mathias Brodala commented on patch set 3 10/15/25, 06:46
Services.yaml:58IMO this should be "l10n:domain:list" or "l10n:domains" or "translation:domains". The term "label" is too generic to be easily understood without context. -
core-ci voted on patch set 2 V -1 10/15/25, 06:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86677
-
Benni Mack commented on patch set 3 10/15/25, 06:57
Services.yaml:58ReplyI thought about this as well... I had translations in the first run, but people misunderstand translations with content translation (translations with connected and copy mode) -
Garvin Hicking commented on patch set 3 10/15/25, 07:02
Similar happens on CLI `label:domain:list`: ``` Label domains in active extensions ================================== In LabelDomainMapper.php line 295: File path must start with "EXT:" ```Reply
In `LabelDomainMaper->findLabelResourcesInPackage()` I can partially patch this fore core extensions with a very ugly hack: ``` if (str_starts_with($file, Environment::getExtensionsPath() . '/')) { $file = 'EXT:' . substr($file, strlen(Environment::getExtensionsPath()) + 1); } elseif (str_starts_with($file, Environment::getFrameworkBasePath() . '/')) { $file = 'EXT:' . substr($file, strlen(Environment::getFrameworkBasePath()) + 1); } elseif (str_starts_with($file, Environment::getProjectPath() . '/vendor/')) { // @todo - wrapped composer installations like https://github.com/ochorocho/tdk do this $file = 'EXT:' . substr($file, strlen(Environment::getProjectPath() . '/vendor') + 1); // Yes, it gets even more hacky than that: $file = str_replace('typo3/cms-', '', $file); // I can top this: $fileParts = explode('/', $file); // ... turns 'typo3/cms-fluid-styled-content' into 'fluid_styled_content' $fileParts[0] = str_replace('-', '_', $fileParts[0]); $file = implode('/', $fileParts); } elseif (str_starts_with($file, Environment::getProjectPath() . '/')) { $file = substr($file, strlen(Environment::getProjectPath()) + 1); } ``` However this chokes on third-party extensions like `bk2k/bootstrap-package` which gets detected as `bk2k`. And theoreticcaly a TYPO3 extension key could be 'bar' while the directory name be `anything/foo` so no straight mapping might be possible on a filesystem basis, without evaluating all the composer JSONs? -
Garvin Hicking commented on patch set 3 10/15/25, 07:47
BeforeLabelResourceResolvedEvent.php:21```suggestion * Event that is fired after a file name has been mapped to a label domain for all files ```LabelDomainMapper.php:63These can be readonly I guess?Feature-93334-LabelDomainMapping.rst:66Did I read this right that the file could also be called just "toolbar.xlf"? In case we want to phase out "locallang..." totally, should we already reference the shorter filenames here already?Feature-93334-LabelDomainMapping.rst:117"Ignored" might be read as "not supported". Maybe better say "Locale prefixes are irrelevant for the resource identifier resolving. These prefixes will internally be properly evaluated for locale-based translations" (something along these words, it's not great yet I admit)Feature-93334-LabelDomainMapping.rst:133Using the FQCN here would allow API linking in the docsFeature-93334-LabelDomainMapping.rst:153This is so helpful. In the past I wrote several CI tests that validate used message files. It would be great if the output of that command could also be available as JSON, so that the CI could read that dynamically and not need to evaluate some CLI table output. -
Benni Mack uploaded patch set 4
V -110/15/25, 08:40 -
core-ci voted on patch set 4 V -1 10/15/25, 08:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86698
-
Benjamin Kott commented on patch set 4 10/15/25, 09:41
Services.yaml:58Replyi agree here, i think we already have "language" with "language:update" assigned. we should find a general place, but i also feel that labels is too generic,and does not reflect the context really "language.domains.list" or move it into translations. i would prefer a longer key, but that really tells me what i am looking at. if we extend this here we should also talk about the catalogue at some point so i could enable new languages via cli. we are really managing the system here, so i guess the confusion comes from spoken context - while you are using it including the descriptions it think it´s safe that there are no confusions, as we are not managing content via cli except from imports and exports. -
Benjamin Kott commented on patch set 4 10/15/25, 09:46
Feature-93334-LabelDomainMapping.rst:65i am not sure about this one, i´ve also noticed this using the cli that atleast for core puts out "typo3/cms-backend" instead of "backend" it feels overly complex, while i think we can maybe support it we should prefer the shorten output and also display this to the users and only fall back to the full composer package name when there is no extension key set. -
Benjamin Kott commented on patch set 4 10/15/25, 10:13
RecordListController.php:628usage of composer namespace, other places use extension -
Benni Mack uploaded patch set 5
V -110/15/25, 12:07 -
Benni Mack commented on patch set 5 10/15/25, 12:09
Reply
I think we should avoid this logic, and go back to just use extension keys.RecordListController.php:628ReplyDoneBeforeLabelResourceResolvedEvent.php:21ReplyDoneLabelDomainMapper.php:63ReplyDoneFeature-93334-LabelDomainMapping.rst:65ReplyDoneFeature-93334-LabelDomainMapping.rst:117ReplyDoneFeature-93334-LabelDomainMapping.rst:133ReplyDone -
core-ci voted on patch set 5 V -1 10/15/25, 12:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86717
-
Garvin Hicking commented on patch set 5 10/15/25, 12:39
Reply
This feels a bit connected to the PKG System Resource API resolve, but the other way round. There requiring composer keys would be beneficial, and here having composer keys is an issue. I feel like we should align this... Fixating this on extension keys would block retiring extension keys in the future if we might make a `composer.json` mandatory. Maybe we should even combine this and also use "PKG:..." here already?! @typo3@helhum.io ? -
Benni Mack uploaded patch set 6
V -110/15/25, 12:45 -
core-ci voted on patch set 6 V -1 10/15/25, 13:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86722
-
Benni Mack commented on patch set 6 10/15/25, 13:18
Reply
The point of this is to easy to syntax for integrators and people writing label references. I asked myself this question (also see @benjamin.kott@outlook.com comment here from today): What's better in terms of understanding and readability? - backend.toolbar:button.save - typo3/cms-backend.toolbar:button.save - PKG:typo3/cms-backend.toolbar:button.save - EXT:backend/Resources/Private/Language/locallang_toolbar.xlf:button.save The point here is not the reference to a specific "file", as it is with system resources API.the first one is VERY VERY similar to what Symfony/Contao/Sulu developers are used to already. -
Benni Mack uploaded patch set 7
V -110/15/25, 13:23 -
Benni Mack uploaded patch set 8 10/15/25, 13:36
-
core-ci voted on patch set 7 V -1 10/15/25, 13:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86729
-
core-ci voted on patch set 8 V -1 10/15/25, 13:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86730
-
Garvin Hicking commented on patch set 8 10/15/25, 14:03
Reply
Ack. Yeah I understand and see why the extension key would be the lean choice. -
Benni Mack uploaded patch set 9
V -110/15/25, 14:03 -
Benni Mack commented on patch set 9 10/15/25, 14:04
Services.yaml:58ReplyHey @mbrodala@pagemachine.de - I changed it to language:domain:list - wdyt? -
Garvin Hicking commented on patch set 9 10/15/25, 14:06
Reply
Unresolving this to keep in mind that composer mode has issues with the resolving yet -
core-ci voted on patch set 9 V -1 10/15/25, 14:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86731
-
Benni Mack uploaded patch set 10
V -110/15/25, 14:26 -
core-ci voted on patch set 10 V -1 10/15/25, 14:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86733
-
Georg Ringer uploaded patch set 11
V -110/15/25, 14:37 -
core-ci voted on patch set 11 V -1 10/15/25, 14:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86734
-
Benni Mack uploaded patch set 12
V -110/15/25, 15:28 -
core-ci voted on patch set 12 V -1 10/15/25, 15:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86743
-
Mathias Brodala commented on patch set 12 10/16/25, 06:34
Services.yaml:58ReplyWay better, thanks! -
Benni Mack uploaded patch set 13
V -110/16/25, 09:56 -
Benni Mack commented on patch set 13 10/16/25, 10:05
Feature-93334-LabelDomainMapping.rst:66ReplyI kept it here because it helps people to understand the previous file structure. I've documented this in other places now that toolbar.xlf takes precedences over locallang_toolbar.xlf etc. -
Garvin Hicking commented on patch set 13 V +1 10/16/25, 10:06
Reply
works now.Feature-93334-LabelDomainMapping.rst:66ReplyDoneFeature-93334-LabelDomainMapping.rst:153ReplyI'll provide this as a follow-up. -
core-ci voted on patch set 13 V +1 10/16/25, 10:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86799
-
Garvin Hicking commented on patch set 13 V 0 10/16/25, 10:26
LanguageDomainListCommand.php:134```suggestion ]); // Make the "Translations" column only emit three 2-letter languages per row $table->setColumnMaxWidth(2, 11); ``` -
Benjamin Kott commented on patch set 13 CR -1 10/16/25, 10:30
LanguageDomainListCommand.php:113i think we should drop the locales here for now, it clutters the view. and makes it more or less unreadable. i think it´s better when this command only lists the essential mapping information and the label count in the base file. we should provide more commands around that in a dedicated patch, where we can debug a single domain and their overwrite resources, that should also consider overrides and installed language packs. -
Garvin Hicking commented on patch set 13 10/16/25, 10:32
The CLI output lists: ``` | core.iso.countries | EXT:core/Resources/Private/Language/Iso/zh-HK.countries.xlf | en, af, ar, ... | 1143 | ``` So the "zh-HK" (last file alphabetically) file is used here. I wonder if it should list only "countries.xlf" here? I have third party extensions with translations (da, de) but fr these the proper "locallang.xlf" is shown... probably because alphabetically "en" comes last and this resets something? Not sure if this is of importance or just a CLI output matter. -
Garvin Hicking commented on patch set 13 10/16/25, 10:33
LanguageDomainListCommand.php:113ReplyPlease check out the suggested patch I made for exactly this output reason. With that it's IMO bearable and has a benefit to be listed... -
Benjamin Kott commented on patch set 13 10/16/25, 10:45
Feature-93334-LabelDomainMapping.rst:33drop LLL:Feature-93334-LabelDomainMapping.rst:54drop LLL:Feature-93334-LabelDomainMapping.rst:137drop LLL:Feature-93334-LabelDomainMapping.rst:140drop LLL: -
Benjamin Kott commented on patch set 13 10/16/25, 10:47
LanguageDomainListCommand.php:113Replyi´ve seen the comment - i think it should be completely removed for now, i see a lot of benefit in more data being available but maybe we need a different command / usecase for this. the main use case here is to get basic information so we should also restrict it to what we actually need here. i think domain to resource mapping and count should be fine here. -
Benni Mack uploaded patch set 14
CR -1V +110/16/25, 10:52 -
Benjamin Kott commented on patch set 13 CR -1 10/16/25, 10:53
LocalizationUtility.php:51i think we should also support full domain names here like core.something even without adding LLL: or adding an extension key. -
core-ci voted on patch set 14 V +1 10/16/25, 11:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86805
-
Benni Mack uploaded patch set 15
V +110/16/25, 12:16 -
Benni Mack commented on patch set 15 10/16/25, 12:17
Reply
DoneLanguageDomainListCommand.php:113Replyagree. removed this for the time beingLanguageDomainListCommand.php:134ReplyDoneFeature-93334-LabelDomainMapping.rst:33ReplyDoneFeature-93334-LabelDomainMapping.rst:54ReplyDoneFeature-93334-LabelDomainMapping.rst:137ReplyDoneFeature-93334-LabelDomainMapping.rst:140ReplyDoneLocalizationUtility.php:51ReplyThis can be done in a separate change, as we then would need to extract and validate the domain name at this very point. -
core-ci voted on patch set 15 V +1 10/16/25, 12:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86808
-
Benjamin Kott voted on patch set 15 CR +1 V +1 10/16/25, 12:40
-
Christian Kuhn commented on patch set 15 10/16/25, 12:43
i've partially read through this and would like to give testing a shot soon. -
Benjamin Kott commented on patch set 15 V 0 CR -1 10/16/25, 12:49
the count of labels is off, and need to be checked again, it reports above 3k labels for a file with 4 labels. -
Benni Mack uploaded patch set 16
CR -1V +110/16/25, 13:42 -
Benni Mack commented on patch set 17 10/16/25, 14:03
Published edit on patch set 16. -
core-ci voted on patch set 16 V -1 10/16/25, 14:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86817
-
Benni Mack uploaded patch set 18 10/16/25, 14:22
-
core-ci voted on patch set 17 V -1 10/16/25, 14:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86819
-
core-ci voted on patch set 18 V -1 10/16/25, 14:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86822
-
Benni Mack uploaded patch set 19
V -110/16/25, 15:12 -
core-ci voted on patch set 19 V -1 10/16/25, 15:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86824
-
Benni Mack uploaded patch set 20
V -110/16/25, 15:35 -
Benni Mack uploaded patch set 21 10/16/25, 15:41
-
Benni Mack commented on patch set 22 10/16/25, 15:43
Published edit on patch set 21. -
core-ci voted on patch set 20 V -1 10/16/25, 16:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86826
-
core-ci voted on patch set 21 V -1 10/16/25, 16:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86827
-
core-ci voted on patch set 22 V -1 10/16/25, 16:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86828
-
Benni Mack uploaded patch set 23
V -110/16/25, 16:10 -
core-ci voted on patch set 23 V -1 10/16/25, 16:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86833
-
Benni Mack uploaded patch set 24
V -110/16/25, 16:54 -
core-ci voted on patch set 24 V +1 10/16/25, 17:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86834
-
Garvin Hicking uploaded patch set 25
V +110/16/25, 19:52 -
Garvin Hicking uploaded patch set 26 10/16/25, 19:54
-
Garvin Hicking uploaded patch set 27 10/16/25, 19:56
-
core-ci voted on patch set 25 V -1 10/16/25, 20:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86843
-
core-ci voted on patch set 26 V -1 10/16/25, 20:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86844
-
core-ci voted on patch set 27 V +1 10/16/25, 20:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86845
-
Garvin Hicking commented on patch set 27 CR +1 V +1 10/16/25, 20:23
💪 -
Georg Ringer voted on patch set 27 CR +1 V +1 10/17/25, 05:56
-
Benjamin Kott voted on patch set 27 CR +2 V +2 10/17/25, 07:31
-
Benjamin Kott merged patch set 28 10/17/25, 07:31
-
Lina Wolf commented on patch set 28 10/22/25, 14:05
Unresolved
We should adjust the changelog example: https://review.typo3.org/c/Packages/TYPO3.CMS/+/91162