Review main Merged

73680[BUGFIX] Use per-language runtime cache for LanguageService

Jan Delius CR +2 V +2 Normal +54 −1 updated 02/23/22, 20:44

Commit message

LanguageService state has been moved into runtime cache
for further reducing the need to keep the LanguageService
in a global state. Failing to predict the need to translate
into multiple languages in the same context and process,
$cacheIdentifier had not be included the language.

This patch adds the current language to the $cacheIndentifier
to support multiple language translation while keeping the
LanguageService state clean.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Jan Delius +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Jan Delius +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 2

Files 2

Review log 1216

  1. Jan Delius uploaded patch set 1 02/23/22, 15:43

  2. Jan Delius commented on patch set 1 02/23/22, 15:46

    To test the patch, you can create a middleware in the frontend, which simply outputs the translation of the "Notes" TCA tab according to the following code. Before the change, the translation of the language "de" came in the JSON in both cases. After the patch, both instances return the correct translation. $language = GeneralUtility::getContainer()->get(LanguageServiceFactory::class)->create('de'); $data1 = $language->sL('LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes'); $language2 = GeneralUtility::getContainer()->get(LanguageServiceFactory::class)->create('default'); $data2 = $language2->sL('LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes'); return new JsonResponse([$data1, $data2]);
  3. core-ci voted on patch set 1 V +1 02/23/22, 15:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24120

  4. Rico Drexler voted on patch set 1 V +1 CR +1 02/23/22, 16:14

  5. Stefan Bürk commented on patch set 1 CR -1 02/23/22, 18:53

    on it
  6. Stefan Bürk uploaded patch set 2 02/23/22, 20:04

  7. Stefan Bürk commented on patch set 2 V +1 CR +1 02/23/22, 20:05

    Changes: * added tests to cover this * added related issue to commit (and issue) * adjusted commit message
  8. Stefan Bürk updated the commit message in patch set 3 02/23/22, 20:07

  9. core-ci voted on patch set 2 V +1 02/23/22, 20:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24144

  10. Jan Delius updated the commit message in patch set 4 02/23/22, 20:19

  11. core-ci voted on patch set 3 V +1 02/23/22, 20:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24145

  12. core-ci voted on patch set 4 V +1 02/23/22, 20:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24146

  13. Stefan Bürk voted on patch set 4 V +1 CR +1 02/23/22, 20:33

  14. Jan Delius voted on patch set 4 V +1 CR +1 02/23/22, 20:39

  15. Benjamin Franzke voted on patch set 4 V +2 CR +2 02/23/22, 20:43

  16. Benjamin Franzke merged patch set 5 02/23/22, 20:44