Review main Merged

93522[TASK] Improve language selector labels for root-level records

Benjamin Kott CR +2 V +2 Hard +196 −64 updated 04/09/26, 07:13

Commit message

For records with pid=0 such as sys_file_metadata, the language selector
in the document header concatenated site identifiers from every
configured site, producing extremely wide labels like
"English [Site: a], English [Site: b], ...".

The language selector now consolidates languages across all sites by
deduplicating titles and appending the language ID as metadata. When
all sites agree on the title for language 0, that title is kept.
When titles differ, a translatable "Default" label is used instead.
For non-default languages with differing titles, all unique titles
are listed. The flag switches to "flags-multiple" whenever titles
or flags are not consistent across sites.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Garvin Hicking +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 7

Review log 1923

  1. Benjamin Kott uploaded patch set 1 04/02/26, 11:11

  2. core-ci voted on patch set 1 V +1 04/02/26, 11:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99472

  3. Benjamin Franzke uploaded patch set 2 V +1 04/02/26, 12:31

  4. core-ci voted on patch set 2 V +1 04/02/26, 12:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99482

  5. Ayke Halder commented on patch set 2 CR -1 04/07/26, 15:39

    TranslationConfigurationProvider.php:126

    This is never read - and just `usnet` in the end: remove.
  6. Ayke Halder commented on patch set 2 04/07/26, 15:50

    TranslationConfigurationProvider.php:81

    Implement this outside `foreach` loop: ``` if (isset($allSystemLanguages[0] && count($allSystemLanguages[0]['knownTitles'] ?? []) > 1) { /* Code for language-id 0 */ … } ```

    TranslationConfigurationProvider.php:123

    Implement `'knownTitles'` outside `foreach` loop and for language id 0 only.
  7. Ayke Halder commented on patch set 2 04/07/26, 16:11

    TranslationConfigurationProvider.php:83

    `flagIcon` logic can be removed here as it is already set in `addSiteLanguagesToConsolidatedList` if there are multiple `'knownTitles'`. Or as alternative: * remove `'title'` and logic for `…['flagIcon'] = 'flags-multiple'` from `addSiteLanguagesToConsolidatedList` * add `'title'` generation here via `$language['title'] = implode(',' , array_keys($language['knownTitles']);` * add `'flags-multiple'` here via `if (count($language['knownTitles']) > 1) { $language['flagIcon'] = 'flags-multiple'; }` .
  8. Ayke Halder commented on patch set 2 04/07/26, 16:14

    TranslationConfigurationProvider.php:75

    The argument `$allSystemLanguages` can be provided as reference to `addSiteLanguagesToConsolidatedList()`.
  9. Ayke Halder commented on patch set 2 04/07/26, 17:13

  10. Benjamin Kott commented on patch set 2 04/08/26, 11:55

    Reply

    its impossible to review the changes in that state, please push a new patchset on this change so we can compare the changes and see what actually has changed.
  11. Ayke Halder uploaded patch set 3 CR +1 V +1 04/08/26, 12:53

  12. Ayke Halder commented on patch set 3 04/08/26, 12:55

    TranslationConfigurationProvider.php:75 Reply

    Done

    TranslationConfigurationProvider.php:81 Reply

    Done

    TranslationConfigurationProvider.php:83 Reply

    Done

    TranslationConfigurationProvider.php:123 Reply

    Done

    TranslationConfigurationProvider.php:126 Reply

    Done
  13. core-ci voted on patch set 3 V +1 04/08/26, 13:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99764

  14. Ayke Halder uploaded patch set 4 V +1 04/08/26, 13:12

  15. Ayke Halder commented on patch set 4 04/08/26, 13:14

  16. core-ci voted on patch set 4 V +1 04/08/26, 13:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99768

  17. Benjamin Kott commented on patch set 4 04/08/26, 13:59

    Reply

    all fine for me, do not really care about the php part - only the result is important
  18. Garvin Hicking commented on patch set 4 04/08/26, 19:29

    I can verify this already optimizes the display in the breadcrumb and also the record listing. However, in the FormEngine TCA edit view the "sys_language_uid" dropdown for me still shows a huge list of all languages instead of "Default" as the first one. I've attached two screenshots for this in the issue (and two that show how it 'properly' renders the record table for me). Is this beyond scope of this patch or a lurking follow-up issue?
  19. Benjamin Kott commented on patch set 4 04/08/26, 20:08

    Reply

    actually, my only goal was to fix the behavior of the document header bar - this was just a nesessitiy
  20. Garvin Hicking commented on patch set 4 CR +1 V +1 04/08/26, 20:18

    Reply

    Acknowledged
  21. Benjamin Franzke voted on patch set 4 CR +2 V +2 04/09/26, 07:12

  22. Benjamin Franzke merged patch set 5 04/09/26, 07:13