Review main Ready for review

96567[TASK] Stop depending on the process locale per request

Benni Mack CR +1 V +1 Hard +365 −102 updated 11/10/26, 18:24

Commit message

SiteResolver changes the locale of the PHP process to the locale of
the site language on every frontend request. The process locale is
shared by all threads, so on thread-based runtimes like FrankenPHP a
request can change the locale of a concurrent one, and in worker
mode it leaks into later requests.

Core read that locale in a few places only. stdWrap.strftime,
stdWrap.bytes, the indexed_search result size and the file size
validators now pass the locale of the site language explicitly.
GeneralUtility::formatSize() receives an optional locale and uses
NumberFormatter instead of temporarily changing LC_NUMERIC. The
select ViewHelpers sort with a Collator for the rendering locale
instead of SORT_LOCALE_STRING.

Locales::setSystemLocaleFromSiteLanguage() is deprecated. Core keeps
setting the process locale in v15 so that third-party code relying
on it keeps working.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 3
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/67/96567/3 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/67/96567/3 && git cherry-pick FETCH_HEAD

Review

  • Code review CR +1 Needs a vote
    • Simon Schaufelberger +1
  • Verified V +1 Needs a vote
    • Simon Schaufelberger +1
    • core-ci +1 CI

Merge conflicts 14

Issues 1

Files 18

Review log 912

  1. Benni Mack uploaded patch set 1 10/09/26, 16:51

  2. core-ci voted on patch set 1 V +1 10/09/26, 17:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110656

  3. Wouter Wolters voted on patch set 1 CR +1 10/09/26, 19:39

  4. Benni Mack voted on patch set 1 CR -1 10/09/26, 19:49

  5. Benni Mack uploaded patch set 2 CR +1 V +1 11/09/26, 13:26

  6. core-ci voted on patch set 2 V +1 11/09/26, 13:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113685

  7. Jochen Roth voted on patch set 2 CR +1 V +1 11/09/26, 14:28

  8. Simon Schaufelberger commented on patch set 2 11/09/26, 15:17

    Deprecation-110967-SetSystemLocaleFromSiteLanguage.rst:70

    This is no clear migration path. We usually expect a "before" version and an "after" version. This also helps with creating a Rector rule for it but I can't accept it in the current state.
  9. Benni Mack uploaded patch set 3 CR +1 V +1 11/10/26, 17:12

  10. Benni Mack commented on patch set 3 11/10/26, 17:12

    Deprecation-110967-SetSystemLocaleFromSiteLanguage.rst:70 Reply

    Done
  11. core-ci voted on patch set 3 V +1 11/10/26, 17:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113924

  12. Simon Schaufelberger voted on patch set 3 CR +1 V +1 11/10/26, 18:24