Review main Merged

92479[BUGFIX] Fix resolving localized strings in language:domain:search CLI

Garvin Hicking CR +2 V +2 Normal +138 −9 updated 01/23/26, 19:28

Commit message

The `bin/typo3 language:domain:search` CLI tool did not properly
access localized language domains.

The reason for this was that extensions (like EXT:core) might
internally ship language files (like de.countries.xlf) and
return only that, when filtering for a locale like "de".

This would then ignore all other possibly existing translations,
stored in the `var/labels/` (or `typo3conf/l10n/`) directory.

To fix this, the array of resource files is now merged with the
base english (en/default) resource array, so that every of these
files is also searched.

This will make a command like this work:

```
vendor/bin/typo3 language:domain:search \
  -e core \
  --locale=de \
  --search=baum
```

Tests are added to fixate this `LabelFinder` behavior, as there
currently were no tests for that class. The output label
is adapted to include the selected locale instead of
hardcoded "(en)".

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Ayke Halder +1
    • Benni Mack +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Ayke Halder +1
    • Benni Mack +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 2

Files 4

Review log 1924

  1. Garvin Hicking uploaded patch set 1 01/23/26, 11:09

  2. core-ci voted on patch set 1 V +1 01/23/26, 11:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94153

  3. Garvin Hicking uploaded patch set 2 V +1 01/23/26, 14:10

  4. core-ci voted on patch set 2 V +1 01/23/26, 14:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94175

  5. Simon Schaufelberger voted on patch set 2 CR +1 V +1 01/23/26, 14:20

  6. Josua Vogel voted on patch set 2 CR +1 V +1 01/23/26, 15:09

  7. Benni Mack voted on patch set 2 CR +2 V +2 01/23/26, 15:29

  8. Garvin Hicking commented on patch set 2 CR -1 01/23/26, 15:31

    missing my test, hang on
  9. Garvin Hicking uploaded patch set 3 CR +1 V +1 01/23/26, 15:34

  10. core-ci voted on patch set 3 V -1 01/23/26, 15:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94183

  11. Garvin Hicking uploaded patch set 4 V -1 01/23/26, 15:50

  12. core-ci voted on patch set 4 V +1 01/23/26, 15:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94186

  13. Benni Mack voted on patch set 4 CR +1 V +1 01/23/26, 16:37

  14. Ayke Halder commented on patch set 4 01/23/26, 16:50

    It finds the "de" translation now! But it says "Label Content (en)" instead of "… (de)", shouldn't it? Command: `ddev exec bin/typo3 language:domain:search -e core --locale=de --search=baum` ``` Labels in extension: core ========================= core.core file EXT:core/Resources/Private/Language/locallang_core.xlf ===================================================================== +-------------------------------------+-----------------------------------------------+ | Label Reference | Label Content (en) | +-------------------------------------+-----------------------------------------------+ | cm.tempMountPoint | Als Startpunkt für den Seitenbaum festlegen | | labels.openPageTreeOptionsMenu | Seitenbaum-Options-Menü öffnen | | labels.temporaryPageTreeEntryPoints | Temporäre Seitenbaum-Einstiegspunkte aufheben | +-------------------------------------+-----------------------------------------------+ core.tca file EXT:core/Resources/Private/Language/locallang_tca.xlf =================================================================== +-----------------------------------------+------------------------------------+ | Label Reference | Label Content (en) | +-----------------------------------------+------------------------------------+ | be_users.options_page_tree_entry_points | Seitenbaum-Einstiegspunkte | | page_tree_entry_points | Seitenbaum-Einstiegspunkte | | php_tree_stop | Verberge Unterseiten im Seitenbaum | +-----------------------------------------+------------------------------------+ core.db.pages file EXT:core/Resources/Private/Language/db/pages.xlf =================================================================== +-----------------+------------------------------------+ | Label Reference | Label Content (en) | +-----------------+------------------------------------+ | php_tree_stop | Verberge Unterseiten im Seitenbaum | +-----------------+------------------------------------+ [OK] Found 3 label references. . ```
  15. Simon Schaufelberger voted on patch set 4 CR +1 V +1 01/23/26, 16:52

  16. Simon Schaufelberger voted on patch set 4 CR 0 V 0 01/23/26, 17:05

  17. Garvin Hicking uploaded patch set 5 CR +1 V +1 01/23/26, 17:39

  18. Garvin Hicking commented on patch set 5 01/23/26, 17:40

    Reply

    good catch, thank you - updated to utilize the locale there.
  19. core-ci voted on patch set 5 V +1 01/23/26, 17:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94193

  20. Simon Schaufelberger voted on patch set 5 CR +1 V +1 01/23/26, 18:39

  21. Ayke Halder voted on patch set 5 CR +1 V +1 01/23/26, 19:17

  22. Benni Mack voted on patch set 5 CR +1 V +1 01/23/26, 19:26

  23. Garvin Hicking commented on patch set 5 CR +2 V +2 01/23/26, 19:27

    Thanks for iterating 😎
  24. Garvin Hicking merged patch set 6 01/23/26, 19:28