91614[TASK] Add CLI command and service to search labels
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Garvin Hicking +1
-
Verified V +2 Done
- Benni Mack +2
- Garvin Hicking +1
- core-ci +1 CI
Issues 1
Files 10
- typo3/sysext/backend/Configuration/Services.yaml+1 −1
- typo3/sysext/core/Classes/Localization/LocalizationFactory.php12+1 −1
- typo3/sysext/core/Configuration/Services.yaml5+0 −7
- typo3/sysext/core/Documentation/Changelog/14.0/Feature-93334-TranslationDomainMapping.rst+5 −1
- typo3/sysext/lowlevel/Classes/Command/TranslationDomainListCommand.phprenamed+2 −1
- typo3/sysext/lowlevel/Classes/Command/TranslationDomainSearchCommand.phpnew+287 −0
- typo3/sysext/lowlevel/Classes/Localization/Dto/DomainSearchResult.phpnew+30 −0
- typo3/sysext/lowlevel/Classes/Localization/Dto/LabelSearchResult.phpnew+27 −0
- typo3/sysext/lowlevel/Classes/Localization/LabelFinder.phpnew+105 −0
- typo3/sysext/lowlevel/Configuration/Services.yaml+14 −0
Review log 3241
Show 1116 earlier messages
-
Lina Wolf uploaded patch set 1 11/13/25, 12:58
-
Lina Wolf updated the commit message in patch set 2 11/13/25, 12:59
-
Lina Wolf updated the commit message in patch set 3 11/13/25, 13:00
-
core-ci voted on patch set 1 V +1 11/13/25, 13:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89495
-
core-ci voted on patch set 2 V +1 11/13/25, 13:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89496
-
core-ci voted on patch set 3 V +1 11/13/25, 13:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89497
-
Garvin Hicking commented on patch set 3 11/13/25, 13:22
TranslationDomainSearchCommand.php:87```suggestion 'Limit results to the first X results.', ```TranslationDomainSearchCommand.php:88I think the default should be unlimitedTranslationDomainSearchCommand.php:95```suggestion 'Crop labels to a maximum of x chars.', ```TranslationDomainSearchCommand.php:103```suggestion 'Output a flat list.' ```TranslationDomainSearchCommand.php:110```suggestion 'Output result as JSON (instead of table or SymfonyStyle messages).' ```TranslationDomainSearchCommand.php:129I think by default we could list all entries, or if restricted to an extension, all of that extension.TranslationDomainSearchCommand.php:215I get an error: ``` PHP Warning: Undefined array key "domain" in /var/www/html/typo3-core/typo3/sysext/core/Classes/Command/TranslationDomainSearchCommand.php line 215 ``` when running `typo3 language:domain:search --search=core` ?TranslationDomainSearchCommand.php:233good idea to pass that in here, nice!LocalizationFactory.php:269I am not sure this method fits the scope of this factory. Either make it a distinct service or be part of the command?LocalizationFactory.php:293Could be inlined in one `if $regex && (!preg_match...))` to reduce nestingLocalizationFactory.php:303I think this array structure is also very specific to the command output. Otherwise if we would use it for more core places we should have a DTO for that and a factory to initialize the DTO with named arguments. (I think an array structure would be fine for the Command scope)LocalizationFactory.php:318```suggestion if ($labelData !== []) { ``` (Maybe even do an "early continue" instead of a nested if, to reduce nestingLocalizationFactory.php:326would "break 2" here allow to remove the lower break?Services.yaml:70Please register new commands directly inside the command, see: https://review.typo3.org/c/Packages/TYPO3.CMS/+/91566/5/typo3/sysext/backend/Classes/Command/DebugBackendModulesCommand.php#40 Also I think in line with that patch we should utilize "debug:language:search" or so, inside a "debug" scope?Feature-107840-AddCLICommandToSearchTranslationLabelsByStringOrRegex.rst:48How about also searching by "identifier" so I can search for "*.module.*" for example? -
Lina Wolf commented on patch set 3 11/13/25, 13:30
TranslationDomainSearchCommand.php:79ReplyFix applied.TranslationDomainSearchCommand.php:87ReplyFix applied.TranslationDomainSearchCommand.php:95ReplyFix applied.TranslationDomainSearchCommand.php:103ReplyFix applied.TranslationDomainSearchCommand.php:110ReplyFix applied.LocalizationFactory.php:318ReplyFix applied. -
Lina Wolf commented on patch set 3 11/13/25, 13:40
TranslationDomainSearchCommand.php:88ReplyI want to prevent ppl from accidently showing to many results and cluttering the console.TranslationDomainSearchCommand.php:129ReplyI want to prevent showing to many labelsLocalizationFactory.php:269ReplyThe method can also be used to search for labels in the backend later on or be called by third party extensions. Commands should contain no logic but the IO, really so that all logic can be reusedServices.yaml:70ReplyAs far as I know it is not yet able to exclude a command from the scheduler using the attribute: https://forge.typo3.org/issues/107151 As it does not make sense to have this command called via the scheduler I decided to register it in the Services.yaml just like the language:domain:list to which it is sister. -
Lina Wolf commented on patch set 4
V +111/13/25, 13:41Published edit on patch set 3. -
Garvin Hicking commented on patch set 4 11/13/25, 13:44
TranslationDomainSearchCommand.php:88ReplyAcknowledgedTranslationDomainSearchCommand.php:129ReplyIt would be very helpful for me to see all of a scope, I think that would be useful. If I don't want to see too many labels, I can filter. If I explicitly want everything, I can't. But it would be a usecase for me. Especially with JSON export, which IMO should have an unlimited/unfiltered option.LocalizationFactory.php:269ReplyOK, but I think we need a distinct service for this then. Could also be moved from the command once such a backend GUI is created. For now it would IMO clutter this service.Services.yaml:70ReplyWhy not schedule this command? If you want to use it as a check when new labels come in. I think it will not hurt to have it schedulable. -
Lina Wolf commented on patch set 4 11/13/25, 13:51
Services.yaml:70ReplyBecause it is writing to the console only, so you cannot use it in a scheduler command -
core-ci voted on patch set 4 V +1 11/13/25, 13:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89505
-
Lina Wolf uploaded patch set 5
V +111/13/25, 14:27 -
Lina Wolf commented on patch set 5 11/13/25, 14:28
TranslationDomainSearchCommand.php:129ReplyDoneTranslationDomainSearchCommand.php:215ReplyDoneLocalizationFactory.php:269ReplyDoneLocalizationFactory.php:293ReplyDoneLocalizationFactory.php:303ReplyDoneLocalizationFactory.php:326ReplyDone -
core-ci voted on patch set 5 V -1 11/13/25, 14:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89520
-
Lina Wolf uploaded patch set 6
V -111/13/25, 15:01 -
Lina Wolf commented on patch set 6 11/13/25, 15:02
Feature-107840-AddCLICommandToSearchTranslationLabelsByStringOrRegex.rst:48ReplyDone -
core-ci voted on patch set 6 V -1 11/13/25, 15:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89531
-
Garvin Hicking commented on patch set 6 11/13/25, 17:04
Awesome, thanks for the reworks - two minor things then I'm good with this! :-)DomainSearchResult.php:4needs declare strict_types and TYPO3 copyright header (also in the other files)LabelFinder.php:23could be final, and "private TranslationDomainMapper"Services.yaml:70ReplyUnderstood. If we choose implement the NonSchedulableInterface, we could apply that here as a follow-up. -
Lina Wolf uploaded patch set 7
V -111/13/25, 21:15 -
core-ci voted on patch set 7 V +1 11/13/25, 21:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89592
-
Lina Wolf commented on patch set 7 11/13/25, 21:23
DomainSearchResult.php:4ReplyDoneLabelFinder.php:23ReplyDone -
Garvin Hicking voted on patch set 7 CR +1 V +1 11/14/25, 18:25
-
Garvin Hicking commented on patch set 7 CR 0 V 0 11/17/25, 13:53
Lina, would you agree on making this internal for now? Move to the debug: namespace like the other twos.Declare the PHP Classes internal. Remove feature rst, make the docs internal to the help output of the command. It's still "wip" so we could make it public once its more stable. For now it would be to big of a burden having it public. -
Lina Wolf commented on patch set 7 11/18/25, 14:33
Reply
I thought this was a feature that we wanted to have. Why would it be WIP now? Why a liability? -
Garvin Hicking commented on patch set 7 11/18/25, 14:37
Reply
Not WIP. Just s/FEATURE/TASK/ et al. This should not become public API (for now), but is there "for us core developers". Thus we need to label it a TASK, and not have a feature RST, and have the backend CLI commands set as "debug:" to indicate this, like the other two ViewHelpers. If you could do this, I would vote to merge this. -
Lina Wolf commented on patch set 7 11/18/25, 14:39
Reply
Why do you want to make this internal. It can be useful for projects as well? -
Lina Wolf commented on patch set 7 11/18/25, 14:42
Reply
The whole idea of this command is to make migration for PPL out there the migration easier with all the labels we are renaming, XLIFF files we are consolidating or moving. The idea is not to have some internal tool. -
Benni Mack commented on patch set 7 11/18/25, 14:53
Reply
I think the main idea is that if we label it as internal, we can still modify the API (PHP code), as people who migrate. Thinking about this more, should we move these commands into EXT:lowlevel, to give this extension some more reason to exist? -
Lina Wolf commented on patch set 7 11/18/25, 15:02
Reply
"internal" tells ppl: do not use this, do not rely on this. And that is not the purpose of this PR. When I write the docs about the label migration I want to tell ppl: Ok, this might seem confusing, but hey! there is a command out there to help you. These preliminary internals tend to stay around long time and hinder usage. Internal should be limited to things that absolutely have to be internal. -
Benni Mack commented on patch set 7 11/18/25, 15:17
Reply
Internal means: This is not covered by the TYPO3 Core backwards-compatibility promise. We've covered this when we introduced the internal property consistently and also wrote a blog post about it back then: https://typo3.org/article/typo3-deprecation-policy#c11597 That came because the code was mixed between "@api" and "@internal" and we wanted clarify what is API what isn't. If we would put a "don't use" on it, we could remove all internal code, because we'd tell "Don't use it". Don't use it != Don't rely on it. People shouldn't rely on the PHP code being like that. -
Lina Wolf commented on patch set 7 11/18/25, 15:56
Reply
Ok, @garvin@hick.ing if you feel it should go into debug: and not be treated as a feature, please feel free to make the adjustments you think are right. In that case I’ll step back from it, since it no longer aligns with what I intended to contribute. All good from my side, no hard feelings. -
Garvin Hicking commented on patch set 7 11/18/25, 17:08
Reply
I will do that (likely also move the ither two debug commands there), thanks. I still think this can readily be used, but we need to seal this off not being API and closed off for refactoring. The command itself can be used. but we might drop it next major version. If it's not internal we are not free to improve on it easily. -
Garvin Hicking uploaded patch set 8
V +111/18/25, 17:48 -
Garvin Hicking updated the commit message in patch set 9 11/18/25, 17:49
-
core-ci voted on patch set 8 V +1 11/18/25, 17:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/90066
-
core-ci voted on patch set 9 V +1 11/18/25, 17:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/90067
-
Garvin Hicking voted on patch set 9 CR +1 V +1 11/18/25, 18:10
-
Benni Mack voted on patch set 9 CR +2 V +2 11/18/25, 18:12
-
Benni Mack merged patch set 10 11/18/25, 18:12
TranslationDomainSearchCommand.php:79