Review main Merged

72805[FEATURE] Add presets when adding new languages for a site

Christoph Lehmann CR +2 V +2 Hard +531 −14 updated 03/22/23, 23:23

Commit message

Presets with default configurations for a site
can be used to create new site languages with one click.

In the language tab of a site record this adds a new drop
down with the presets.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Guido Schmechel +1
  • Verified V +2 Done
    • Benni Mack +2
    • Guido Schmechel +1
    • core-ci +1 CI

Issues 1

Files 8

Review log 5680

Show 3955 earlier messages
  1. Christoph Lehmann uploaded patch set 1 12/28/21, 05:03

  2. core-ci voted on patch set 1 V -1 12/28/21, 05:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21473

  3. Stefan Bürk uploaded patch set 2 12/30/21, 16:34

  4. core-ci voted on patch set 2 V +1 12/30/21, 16:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21527

  5. Stefan Bürk commented on patch set 2 01/14/22, 23:12

    Note: Only fixed cgl issues with patchset 2. This is still "[WIP]", regardin the commit message. So feel to proceed. Was just to "help" out.
  6. Benni Mack commented on patch set 2 01/21/22, 23:29

    Locales.php:135

    I suggest to move this to its own class next to SiteLanguage, just called "SiteLanguagePresets"
  7. Christoph Lehmann commented on patch set 2 01/24/22, 09:29

    I try to finalize it asap.

    Locales.php:135 Reply

    Yes, that's better. Will do.
  8. Christoph Lehmann rebased onto patch set 3 01/27/22, 22:57

  9. core-ci voted on patch set 3 V +1 01/27/22, 23:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22604

  10. Christoph Lehmann uploaded patch set 4 01/27/22, 23:19

  11. Christoph Lehmann updated the commit message in patch set 5 01/27/22, 23:31

  12. core-ci voted on patch set 4 V -1 01/27/22, 23:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22605

  13. core-ci voted on patch set 5 V -1 01/27/22, 23:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22606

  14. Christoph Lehmann uploaded patch set 6 V -1 12/04/22, 22:09

  15. core-ci voted on patch set 6 V +1 12/04/22, 22:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34613

  16. Christoph Lehmann uploaded patch set 7 V +1 12/04/22, 22:33

  17. Christoph Lehmann updated the commit message in patch set 8 12/04/22, 22:37

  18. Christoph Lehmann commented on patch set 8 12/04/22, 22:37

    Locales.php:135 Reply

    Done
  19. core-ci voted on patch set 7 V +1 12/04/22, 22:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34614

  20. core-ci voted on patch set 8 V +1 12/04/22, 22:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34615

  21. Christoph Lehmann uploaded patch set 9 V +1 12/08/22, 19:42

  22. Christoph Lehmann updated the commit message in patch set 10 12/08/22, 19:42

  23. core-ci voted on patch set 10 V -1 12/08/22, 19:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34813

  24. core-ci voted on patch set 9 V -1 12/08/22, 19:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34812

  25. Stefan Bürk commented on patch set 10 12/08/22, 19:54

    Rest file should be moved to 12.2 (eventually rebase patch before to have folder)
  26. Christoph Lehmann uploaded patch set 11 V -1 12/08/22, 20:08

  27. Christoph Lehmann commented on patch set 11 12/08/22, 20:10

    Reply

    Done
  28. core-ci voted on patch set 11 V +1 12/08/22, 20:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34814

  29. Guido Schmechel commented on patch set 11 V +1 12/12/22, 09:59

    Regardless of the point to be made, it all worked out well. Nice feature!

    SiteLanguagePresets.php:540

    To be clarified
  30. Christoph Lehmann commented on patch set 11 12/12/22, 10:03

    SiteLanguagePresets.php:540 Reply

    I didn't find a flag for Zimbabwe.
  31. Guido Schmechel commented on patch set 11 12/12/22, 10:18

    SiteLanguagePresets.php:540 Reply

    "zw" would be the correct value. You can also specify this. The problem is rather that the flag of Andorra is currently being issued there: => https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Resources/Public/Icons/Flags/ZW.png https://en.wikipedia.org/wiki/Flag_of_Andorra
  32. Guido Schmechel commented on patch set 11 12/12/22, 10:22

    SiteLanguagePresets.php:540 Reply

  33. Stefan Bürk commented on patch set 11 12/12/22, 11:25

    Some things we should at least talk about (for eventually following ups): unrelated to this change: * normally, the drop down only contains locales installed on the system for selection * no-validation if the locale is still valid (installed) available, visually or something like that related to this change: * pre-sets lists `<locale>.UTF-8` without checking if they are installed on the system * pre-sets list do not take into account eventually sub-locales of the system, e.g 'de_DE.UTF-8@euro' Providing the pre-sets may lead to simply creating languages without valid system locales installed, and without further notices. The "normal" way it listed at least available locales on the current system it is executed. We should at least having some todo's to tackle here some issues. And eventually provide "pre-sets" only if locale is installed or something like that. At least we should discuss about these things here. Beside this, nice change and a change which basicly makes sense.
  34. Christoph Lehmann commented on patch set 11 12/12/22, 12:50

    Reply

    Talked to Benny last week, he wanted to go on with it and merge changes in his new Feature "Locales instead typo3language". But yes, the problem with non-existing locales is still valid, good catch. How about a FlashMessage "The locale is currently not available on your system" in the newly created IRRE-element?
  35. Christoph Lehmann commented on patch set 11 12/12/22, 21:05

    Reply

    Just fyi about the @euro modifier: https://wiki.archlinux.de/title/Locale#:~:text=Der%20Sonderfall%20de_DE.utf8%40euro,das%20Eurozeichen%20explizit%20vorhanden%20ist. states, that it's usage is contra-productive, because the locale falls back to ISO-8859-15 which does not contain all unicode characters.
  36. Andreas Kienast commented on patch set 11 12/13/22, 14:59

    SiteLanguagePresets.php:540 Reply

    Issue is solved.
  37. Georg Ringer commented on patch set 11 12/13/22, 17:39

    Feature-99321-AddSiteLanguagePresets.rst:21

    just from reading, I don't really know which time I save as integrator? would I have presets in my site package for the most uses languages and then I can use those instead of manually adopting the site configuration or copy paste from some other places?
  38. Christoph Lehmann commented on patch set 11 12/13/22, 19:27

    Feature-99321-AddSiteLanguagePresets.rst:21 Reply

    "Integrators spend less time adding new site languages by using site language presets which provide sensible and common default values for all site language properties." What do you think of that?
  39. Christoph Lehmann commented on patch set 12 V +1 12/13/22, 21:44

    Published edit on patch set 11.
  40. Christoph Lehmann commented on patch set 12 12/13/22, 21:46

    SiteLanguagePresets.php:540 Reply

    Thanks. I added 'zw' as flag and removed the comment.
  41. core-ci voted on patch set 12 V +1 12/13/22, 21:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35069

  42. Georg Ringer commented on patch set 12 V +1 CR +1 12/14/22, 05:48

    Feature-99321-AddSiteLanguagePresets.rst:21 Reply

    Ack
  43. Jörg Bösche voted on patch set 12 CR +1 12/15/22, 15:22

  44. Guido Schmechel commented on patch set 12 V +1 CR +1 12/15/22, 21:56

    The current state is already completely fine! However, I still have a question: Does it make sense to add an event for the presets? Is that worthwhile? With https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Localization/ManagingTranslations.html#custom-languages there would still be an edge case. The custom language itself is a special case, so a preset might not be worth it. But if, for example, you add "Swiss german" to every project for your customers, it might be helpful? What is your opinion on this?
  45. Benni Mack commented on patch set 12 12/20/22, 17:06

    Personally, I think we should avoid setlocale() in general (one of the reasons strftime is deprecated btw) and fully build on top of php-intl.
  46. Georg Ringer rebased onto patch set 13 CR +1 V +1 12/29/22, 08:36

  47. core-ci voted on patch set 13 V +1 12/29/22, 08:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35388

  48. Chris Müller uploaded patch set 14 V +1 02/08/23, 17:57

  49. core-ci voted on patch set 14 V +1 02/08/23, 18:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37404

  50. Josef Glatz commented on patch set 14 CR -1 02/08/23, 18:25

    SiteLanguageContainer.html:12

    Are we safe for every translated language if we don't add the three dots to the translated string?
  51. Josef Glatz commented on patch set 15 CR -1 V +1 02/08/23, 18:27

    Published edit on patch set 14.
  52. core-ci voted on patch set 15 V +1 02/08/23, 19:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37407

  53. Josef Glatz commented on patch set 15 CR -1 02/08/23, 19:14

    SiteLanguageContainer.html:12 Reply

    imagine a RTL language. I would add this also to the LLL string
  54. Benni Mack uploaded patch set 16 CR -1 V +1 02/10/23, 14:39

  55. core-ci voted on patch set 16 V -1 02/10/23, 15:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37566

  1. Christoph Lehmann rebased onto patch set 17 V -1 02/10/23, 22:32

  2. core-ci voted on patch set 17 V +1 02/10/23, 22:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37591

  3. Christoph Lehmann uploaded patch set 18 V +1 02/10/23, 23:07

  4. Christoph Lehmann commented on patch set 18 02/10/23, 23:09

    SiteLanguageContainer.html:12 Reply

    Done
  5. core-ci voted on patch set 18 V +1 02/10/23, 23:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37592

  6. Christoph Lehmann uploaded patch set 19 V +1 02/10/23, 23:21

  7. Christoph Lehmann uploaded patch set 20 02/10/23, 23:21

  8. Christoph Lehmann commented on patch set 20 02/10/23, 23:24

    Reply

    Let's care about unavailable locales in a further issue. I would a warning in system environment check.
  9. core-ci voted on patch set 19 V +1 02/10/23, 23:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37593

  10. core-ci voted on patch set 20 V +1 02/10/23, 23:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37594

  11. Benni Mack commented on patch set 20 02/11/23, 09:48

    Added some feedback. Once this is done, I can take care of the other remarks from Stefan etc.

    SiteInlineAjaxController.php:121

    ->getPresetDetailsForLanguage($language);

    SiteLanguageContainer.php:149

    we could move this logic below into the Presets class ("getAllForSelector()").

    SiteLanguageContainer.php:214

    needs also a XLF part, I assume

    SiteLanguageContainer.html:16

    just from testing (and we do have the styling in there. we should use the regular classes to define a bit of styling instead of having inline styles.

    SiteLanguagePresets.php:41

    really good. now... could we use the actual locale like "cs-CZ" as key of the arrays? this way we are prepared for even further streamlining work.
  12. Christoph Lehmann uploaded patch set 21 V +1 02/14/23, 21:52

  13. Christoph Lehmann commented on patch set 21 02/14/23, 21:53

    SiteInlineAjaxController.php:121 Reply

    Done

    SiteLanguageContainer.php:149 Reply

    Done

    SiteLanguageContainer.php:214 Reply

    removed since superflous

    SiteLanguagePresets.php:41 Reply

    Done
  14. core-ci voted on patch set 21 V +1 02/14/23, 22:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37716

  15. Benni Mack uploaded patch set 22 V +1 03/07/23, 06:55

  16. core-ci voted on patch set 22 V -1 03/07/23, 07:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38576

  17. Andreas Kienast uploaded patch set 23 V -1 03/07/23, 17:12

  18. core-ci voted on patch set 23 V -1 03/07/23, 17:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38617

  19. Benni Mack uploaded patch set 24 V -1 03/22/23, 21:09

  20. Benni Mack voted on patch set 24 V +1 CR +1 03/22/23, 21:10

  21. Benni Mack commented on patch set 24 03/22/23, 21:10

    SiteLanguageContainer.html:16 Reply

    Done
  22. core-ci voted on patch set 24 V +1 03/22/23, 21:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39418

  23. Guido Schmechel voted on patch set 24 V +1 CR +1 03/22/23, 23:12

  24. Benni Mack voted on patch set 24 V +2 CR +2 03/22/23, 23:23

  25. Benni Mack merged patch set 25 03/22/23, 23:23