Review main Merged

68186[FEATURE] Provide list of available system locales

Georg Ringer CR +2 V +2 Normal +48 −4 updated 04/04/21, 20:04

Commit message

Providing a list of available locales makes it faster
and less error prone to setup a site and its languages.

Review

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

Issues 1

Files 3

Review log 2030

Show 35 earlier messages
  1. Georg Ringer uploaded patch set 1 03/04/21, 19:03

  2. Georg Ringer commented on patch set 1 03/04/21, 19:03

    This change is ready for review.
  3. TYPO3com voted on patch set 1 V +1 03/04/21, 19:11 Completed build in 07m 40s on Thu, 4 Mar, 07:11 PM Test Summary: 32742 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9849

  4. core-ci voted on patch set 1 V +1 03/04/21, 19:14 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1179

  5. Oli Bartsch commented on patch set 1 03/04/21, 20:23

    UserFunctions.php:95 Unresolved

    How should we handle the case, `exec` is disabled? Since this leads to a PHP Warning which is also displayed as flash message directly in the module. Furthermore is the value picker just empty in this case, which is IMO bad from a UX perspective.
  1. Tymoteusz Motylewski commented on patch set 1 03/04/21, 20:52

    Will this work on windows too? maybe a more reliable solution would be to use \ResourceBundle::getLocales('') from intl package?
  2. Oli Bartsch commented on patch set 1 03/04/21, 21:40

    Reply

    I'm not a locale expert, however, I'm quite unsure if this will work. Looking at the consuming code, setlocale() is used, which is based on the C locale features, while intl uses the ICU library. Besides that, intl is not defined as dependency by the Core and the required symfony polyfill only provides limited fallbacks, e.g. no ResourceBundle (according to https://github.com/symfony/polyfill-intl-icu#symfony-polyfill--intl-icu).
  3. Georg Ringer uploaded patch set 2 03/08/21, 19:43

  4. TYPO3com voted on patch set 2 V +1 03/08/21, 19:52 Completed build in 09m 00s on Mon, 8 Mar, 07:52 PM Test Summary: 32637 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9942

  5. core-ci voted on patch set 2 V +1 03/08/21, 19:55 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1286

  6. Guido Schmechel commented on patch set 2 V +1 CR +1 03/08/21, 21:09

    Successfully tested with default ddev and custom php.ini for "disable_functions" Nice improvement :-)
  7. Benni Mack commented on patch set 3 03/10/21, 10:38

    Published edit on patch set 2.
  8. core-ci voted on patch set 3 V +1 03/10/21, 10:49 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1362

  9. TYPO3com voted on patch set 3 V -1 03/10/21, 10:51 Completed build in 12m 19s on Wed, 10 Mar, 10:51 AM Test Summary: 2 of 32916 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10004

  10. Josef Glatz commented on patch set 3 CR +1 03/10/21, 11:42

    The only thing I found for Windows was https://stackoverflow.com/posts/23286243/revisions. I also had no real positive findings via the INTL module. > `ResourceBundle::getLocales('')` > just return all available languages of the INTL package. So this is no good way. Maybe it makes sense – for non *nix OSes – to extend the UserFunction for TCA later. The actual implementation is fine for all supported environments. I think doing a progressive enhancement here is the way to go!
  11. Josef Glatz voted on patch set 3 V +1 03/10/21, 12:24

  12. Josef Glatz commented on patch set 4 03/10/21, 13:19

    Published edit on patch set 3.
  13. Josef Glatz voted on patch set 4 V +1 CR +1 03/10/21, 13:19

  14. TYPO3com voted on patch set 4 V +1 03/10/21, 13:28 Completed build in 08m 55s on Wed, 10 Mar, 01:28 PM Test Summary: 32680 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10012

  15. core-ci voted on patch set 4 V +1 03/10/21, 13:39 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1370

  16. Guido Schmechel commented on patch set 4 V +1 CR +1 03/10/21, 18:30

    Does it make sense to filter the list a little bit? e.g. If "de_DE.UTF-8" exists, remove "de_DE" from the list? Or do we give the user more freedom? I also have hits like "C" and "Posix". Maybe a regex like "(.*)_(.*)" could help here? Basically, the feature works ;-)
  17. Josef Glatz commented on patch set 4 03/15/21, 08:54

    Reply

    i would not remove any of those except for "Posix". We had some problems when hoster updated or worked on their (shared) hosting environments and removed some of the available locales. In other words: we had some situations where I set the value to `de_AT.UTF-8` without any fallback. And after some months the customer reported about wrong datetime stuff on the website. Due to some not planned provisioning/upgrades on the server side the locale was gone. But `de_AT` was there. Only the `UTF_8` variant wasn't there anymore. So if I had set the value in TYPO3 to something like `'de_AT.UTF-8, de_DE.UTF-8, de_AT, de_DE, de'` the problem would not be "so" hard. For english locales I often set 'en_US.UTF-8, en_GB.UTF-8, en_US, en_GB, en, C' And there might be also some situations where en_EN or en_US locales are not installed. In that situation it's good to have `C` available. offtopic: Whenever you're involved in such situations it might be a good idea to monitor the locales!

    Feature-93651-ProvideListOfAvailableSystemLocales.rst:13

    I really would love to inform people, that fallbacks can be added comma separated. We often had cases on externally managed webservers, were locales where gone without knowing after any updates by the system maintainers.
  18. Benni Mack commented on patch set 4 03/17/21, 07:23

    Feature-93651-ProvideListOfAvailableSystemLocales.rst:13 Reply

    Should go into docs.typo3.org, right?
  19. Georg Ringer commented on patch set 4 03/17/21, 10:53

    Feature-93651-ProvideListOfAvailableSystemLocales.rst:13 Reply Unresolved

    + add a tca description
  20. Georg Ringer rebased onto patch set 5 03/24/21, 19:17

  21. TYPO3com voted on patch set 5 V +1 03/24/21, 19:25 Completed build in 07m 36s on Wed, 24 Mar, 07:25 PM Test Summary: 32916 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10337

  22. core-ci voted on patch set 5 V +1 03/24/21, 19:32 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1819

  23. Guido Schmechel commented on patch set 5 V +1 CR +1 03/24/21, 21:06

    Reply

    Thanks for for your detailed explanation :-)
  24. Benni Mack commented on patch set 5 V +2 CR +2 04/04/21, 20:04

    I think the benefit of this change for the majority outweighs the limitations on certain installations where the valuePicker would not be populated, so let's move forward and get it in!
  25. Benni Mack merged patch set 6 04/04/21, 20:04