From 4cce546298fba7c22f573735f4d673e1ca6f53dc Mon Sep 17 00:00:00 2001
From: Benjamin Franzke <bfr@qbus.de>
Date: Wed, 2 Jun 2021 09:02:26 +0200
Subject: [PATCH] [TASK] Mark LanguageService container entry as deprecated
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Only the container entry – which acts as backend for
GeneralUtility::makeInstance(LanguageService::class) is
deprecated. The class is left as-is, but should be
factored via LanguageServiceFactory.

Therefore also all the factory methods are deprecated
in order for the LanguageServiceFactory to be used instead.

Resolves: #94414
Releases: master
Change-Id: Iab0f713a5baf95c419338748e8df4102d46c37a4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69367
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack <benni@typo3.org>
---
 .../Middleware/BackendUserAuthenticator.php   | 17 ++++--
 .../Classes/Console/CommandApplication.php    | 10 ++--
 typo3/sysext/core/Classes/Core/Bootstrap.php  |  4 +-
 .../Classes/Information/Typo3Information.php  |  4 +-
 .../Classes/Localization/LanguageService.php  | 20 ++++---
 .../Localization/LanguageServiceFactory.php   | 19 +++++--
 typo3/sysext/core/Classes/ServiceProvider.php |  3 +-
 typo3/sysext/core/Configuration/Services.yaml |  5 +-
 ...DeprecateLanguageServiceContainerEntry.rst | 53 +++++++++++++++++++
 .../Provider/RecoveryCodesProviderTest.php    |  4 +-
 .../Mfa/Provider/TotpProviderTest.php         |  4 +-
 .../Database/QueryGeneratorTest.php           |  4 +-
 .../Localization/LanguageServiceTest.php      |  8 ++-
 .../Functional/Page/PageRendererTest.php      |  4 +-
 .../Tca/BackendGroupsVisibleFieldsTest.php    |  4 +-
 .../Tca/BackendUsersVisibleFieldsTest.php     |  6 +--
 .../Tca/CategoryVisibleFieldsTest.php         |  4 +-
 .../Tca/FileCollectionVisibleFieldsTest.php   |  4 +-
 .../Tca/FileMetadataVisibleFieldsTest.php     |  4 +-
 .../Tca/FileStorageVisibleFieldsTest.php      |  4 +-
 .../Tca/FilemountsVisibleFieldsTest.php       |  4 +-
 .../Tca/LanguageVisibleFieldsTest.php         |  4 +-
 .../Functional/Tca/NewsVisibleFieldsTest.php  |  4 +-
 .../Functional/Tca/PagesVisibleFieldsTest.php |  4 +-
 .../ActionControllerValidationTest.php        |  6 +--
 .../RegularExpressionValidatorTest.php        |  4 +-
 .../Classes/Report/ExtensionStatus.php        |  4 +-
 .../Tca/ContentVisibleFieldsTest.php          |  4 +-
 .../Tca/FileMetadataVisibleFieldsTest.php     |  4 +-
 .../Be/Labels/CshViewHelperTest.php           |  4 +-
 .../Tca/ContentVisibleFieldsTest.php          |  4 +-
 .../Processors/FinisherOptionGenerator.php    |  6 +--
 .../Mvc/Validation/MimeTypeValidatorTest.php  |  4 +-
 .../TypoScriptFrontendController.php          |  3 +-
 .../Middleware/BackendUserAuthenticator.php   | 15 +++++-
 .../Tca/BackendLayoutVisibleFieldsTest.php    |  4 +-
 .../Tca/ContentVisibleFieldsTest.php          |  4 +-
 .../Tca/FrontendGroupsVisibleFieldsTest.php   |  4 +-
 .../Tca/FrontendUsersVisibleFieldsTest.php    |  4 +-
 .../PagesLanguageOverlayVisibleFieldsTest.php |  4 +-
 .../Tca/TemplateVisibleFieldsTest.php         |  4 +-
 .../Menu/AbstractMenuContentObjectTest.php    |  2 +-
 .../TypoScriptFrontendControllerTest.php      | 17 +++---
 .../Php/MethodCallStaticMatcher.php           | 21 ++++++++
 .../Tests/Functional/LinkAnalyzerTest.php     |  4 +-
 .../RecordList/CsvExportRecordListTest.php    |  4 +-
 .../Functional/Service/SlugServiceTest.php    |  4 +-
 .../Controller/BrowseLinksController.php      |  5 +-
 .../Tca/TaskGroupVisibleFieldsTest.php        |  4 +-
 .../Controller/SetupModuleController.php      | 13 ++---
 .../Functional/Tca/NoteVisibleFieldsTest.php  |  4 +-
 .../Classes/Middleware/WorkspacePreview.php   |  3 +-
 .../Tca/WorkspaceStageVisibleFieldsTest.php   |  4 +-
 .../Tca/WorkspaceVisibleFieldsTest.php        |  4 +-
 54 files changed, 251 insertions(+), 121 deletions(-)
 create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Deprecation-94414-DeprecateLanguageServiceContainerEntry.rst

diff --git a/typo3/sysext/backend/Classes/Middleware/BackendUserAuthenticator.php b/typo3/sysext/backend/Classes/Middleware/BackendUserAuthenticator.php
index 0a9e0caf10f0..6bf503b81ee2 100644
--- a/typo3/sysext/backend/Classes/Middleware/BackendUserAuthenticator.php
+++ b/typo3/sysext/backend/Classes/Middleware/BackendUserAuthenticator.php
@@ -25,10 +25,11 @@ use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Authentication\Mfa\MfaProviderManifestInterface;
 use TYPO3\CMS\Core\Authentication\Mfa\MfaRequiredException;
+use TYPO3\CMS\Core\Context\Context;
 use TYPO3\CMS\Core\Controller\ErrorPageController;
 use TYPO3\CMS\Core\Http\HtmlResponse;
 use TYPO3\CMS\Core\Http\RedirectResponse;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Messaging\AbstractMessage;
 use TYPO3\CMS\Core\Session\UserSessionManager;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -60,6 +61,16 @@ class BackendUserAuthenticator extends \TYPO3\CMS\Core\Middleware\BackendUserAut
         '/ajax/core/requirejs',
     ];
 
+    private LanguageServiceFactory $languageServiceFactory;
+
+    public function __construct(
+        Context $context,
+        LanguageServiceFactory $languageServiceFactory
+    ) {
+        parent::__construct($context);
+        $this->languageServiceFactory = $languageServiceFactory;
+    }
+
     /**
      * Calls the bootstrap process to set up $GLOBALS['BE_USER'] AND $GLOBALS['LANG']
      *
@@ -112,7 +123,7 @@ class BackendUserAuthenticator extends \TYPO3\CMS\Core\Middleware\BackendUserAut
         if ($this->context->getAspect('backend.user')->isLoggedIn()) {
             $GLOBALS['BE_USER']->initializeBackendLogin();
         }
-        $GLOBALS['LANG'] = LanguageService::createFromUserPreferences($GLOBALS['BE_USER']);
+        $GLOBALS['LANG'] = $this->languageServiceFactory->createFromUserPreferences($GLOBALS['BE_USER']);
         // Re-setting the user and take the workspace from the user object now
         $this->setBackendUserAspect($GLOBALS['BE_USER']);
         $response = $handler->handle($request);
@@ -171,7 +182,7 @@ class BackendUserAuthenticator extends \TYPO3\CMS\Core\Middleware\BackendUserAut
     ): ResponseInterface {
         // GLOBALS[LANG] needs to be set up, because the UriBuilder is generating a token, which in turn
         // needs the FormProtectionFactory, which then builds a Message Closure with GLOBALS[LANG] (hacky, yes!)
-        $GLOBALS['LANG'] = LanguageService::createFromUserPreferences($user);
+        $GLOBALS['LANG'] = $this->languageServiceFactory->createFromUserPreferences($user);
         $uri = GeneralUtility::makeInstance(UriBuilder::class)
             ->buildUriWithRedirectFromRequest(
                 'auth_mfa',
diff --git a/typo3/sysext/core/Classes/Console/CommandApplication.php b/typo3/sysext/core/Classes/Console/CommandApplication.php
index 7103b823db28..61218e5f9941 100644
--- a/typo3/sysext/core/Classes/Console/CommandApplication.php
+++ b/typo3/sysext/core/Classes/Console/CommandApplication.php
@@ -32,7 +32,7 @@ use TYPO3\CMS\Core\Core\BootService;
 use TYPO3\CMS\Core\Core\Bootstrap;
 use TYPO3\CMS\Core\Core\Environment;
 use TYPO3\CMS\Core\Information\Typo3Version;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 
 /**
  * Entry point for the TYPO3 Command Line for Commands
@@ -48,18 +48,22 @@ class CommandApplication implements ApplicationInterface
 
     protected BootService $bootService;
 
+    protected LanguageServiceFactory $languageServiceFactory;
+
     protected Application $application;
 
     public function __construct(
         Context $context,
         CommandRegistry $commandRegistry,
         ConfigurationManager $configurationMananger,
-        BootService $bootService
+        BootService $bootService,
+        LanguageServiceFactory $languageServiceFactory
     ) {
         $this->context = $context;
         $this->commandRegistry = $commandRegistry;
         $this->configurationManager = $configurationMananger;
         $this->bootService = $bootService;
+        $this->languageServiceFactory = $languageServiceFactory;
 
         $this->checkEnvironmentOrDie();
         $this->application = new Application('TYPO3 CMS', sprintf(
@@ -103,7 +107,7 @@ class CommandApplication implements ApplicationInterface
         $this->initializeContext();
         // create the BE_USER object (not logged in yet)
         Bootstrap::initializeBackendUser(CommandLineUserAuthentication::class);
-        $GLOBALS['LANG'] = LanguageService::createFromUserPreferences($GLOBALS['BE_USER']);
+        $GLOBALS['LANG'] = $this->languageServiceFactory->createFromUserPreferences($GLOBALS['BE_USER']);
         // Make sure output is not buffered, so command-line output and interaction can take place
         ob_clean();
 
diff --git a/typo3/sysext/core/Classes/Core/Bootstrap.php b/typo3/sysext/core/Classes/Core/Bootstrap.php
index cf38dbdb5001..bcb53c88a06c 100644
--- a/typo3/sysext/core/Classes/Core/Bootstrap.php
+++ b/typo3/sysext/core/Classes/Core/Bootstrap.php
@@ -35,7 +35,7 @@ use TYPO3\CMS\Core\Database\TableConfigurationPostProcessingHookInterface;
 use TYPO3\CMS\Core\DependencyInjection\Cache\ContainerBackend;
 use TYPO3\CMS\Core\DependencyInjection\ContainerBuilder;
 use TYPO3\CMS\Core\IO\PharStreamWrapperInterceptor;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Log\LogManager;
 use TYPO3\CMS\Core\Package\FailsafePackageManager;
 use TYPO3\CMS\Core\Package\PackageManager;
@@ -592,6 +592,6 @@ class Bootstrap
     public static function initializeLanguageObject()
     {
         /** @var \TYPO3\CMS\Core\Localization\LanguageService $GLOBALS['LANG'] */
-        $GLOBALS['LANG'] = LanguageService::createFromUserPreferences($GLOBALS['BE_USER']);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->createFromUserPreferences($GLOBALS['BE_USER']);
     }
 }
diff --git a/typo3/sysext/core/Classes/Information/Typo3Information.php b/typo3/sysext/core/Classes/Information/Typo3Information.php
index f1c461fd7d07..9dd2aac0dd69 100644
--- a/typo3/sysext/core/Classes/Information/Typo3Information.php
+++ b/typo3/sysext/core/Classes/Information/Typo3Information.php
@@ -18,6 +18,8 @@ declare(strict_types=1);
 namespace TYPO3\CMS\Core\Information;
 
 use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
  * Contains information and links, or copyright information for the project.
@@ -42,7 +44,7 @@ class Typo3Information
         } elseif (($GLOBALS['LANG'] ?? null) instanceof LanguageService) {
             $this->languageService = $GLOBALS['LANG'];
         } else {
-            $this->languageService = LanguageService::create('default');
+            $this->languageService = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
         }
     }
 
diff --git a/typo3/sysext/core/Classes/Localization/LanguageService.php b/typo3/sysext/core/Classes/Localization/LanguageService.php
index c93a6cd4e378..a13dbb4f349e 100644
--- a/typo3/sysext/core/Classes/Localization/LanguageService.php
+++ b/typo3/sysext/core/Classes/Localization/LanguageService.php
@@ -104,8 +104,7 @@ class LanguageService
 
     /**
      * Initializes the language to fetch XLF labels for.
-     * $languageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Localization\LanguageService::class);
-     * $languageService->init($GLOBALS['BE_USER']->user['lang']);
+     * $languageService = GeneralUtility::makeInstance(LanguageServiceFactory::class)->createFromUserPreferences($GLOBALS['BE_USER']);
      *
      * @throws \RuntimeException
      * @param string $languageKey The language key (two character string from backend users profile)
@@ -356,22 +355,29 @@ class LanguageService
      *
      * @param string $locale the locale (= the TYPO3-internal locale given)
      * @return static
+     * @deprecated since TYPO3 v11.3, will be removed in v12.0
      */
     public static function create(string $locale): self
     {
+        trigger_error('Method ' . __METHOD__ . ' is deprecated and will be removed in TYPO3 12.0 Use LanguageServiceFactory instead.', E_USER_DEPRECATED);
         return GeneralUtility::makeInstance(LanguageServiceFactory::class)->create($locale);
     }
 
+    /**
+     * @deprecated since TYPO3 v11.3, will be removed in v12.0
+     */
     public static function createFromUserPreferences(?AbstractUserAuthentication $user): self
     {
-        if ($user->user['lang'] ?? false) {
-            return static::create($user->user['lang']);
-        }
-        return static::create('default');
+        trigger_error('Method ' . __METHOD__ . ' is deprecated and will be removed in TYPO3 12.0 Use LanguageServiceFactory instead.', E_USER_DEPRECATED);
+        return GeneralUtility::makeInstance(LanguageServiceFactory::class)->createFromUserPreferences($user);
     }
 
+    /**
+     * @deprecated since TYPO3 v11.3, will be removed in v12.0
+     */
     public static function createFromSiteLanguage(SiteLanguage $language): self
     {
-        return static::create($language->getTypo3Language());
+        trigger_error('Method ' . __METHOD__ . ' is deprecated and will be removed in TYPO3 12.0 Use LanguageServiceFactory instead.', E_USER_DEPRECATED);
+        return GeneralUtility::makeInstance(LanguageServiceFactory::class)->createFromSiteLanguage($language);
     }
 }
diff --git a/typo3/sysext/core/Classes/Localization/LanguageServiceFactory.php b/typo3/sysext/core/Classes/Localization/LanguageServiceFactory.php
index 3768d42bf592..d4065621f1da 100644
--- a/typo3/sysext/core/Classes/Localization/LanguageServiceFactory.php
+++ b/typo3/sysext/core/Classes/Localization/LanguageServiceFactory.php
@@ -17,9 +17,9 @@ declare(strict_types=1);
 
 namespace TYPO3\CMS\Core\Localization;
 
-/**
- * @internal
- */
+use TYPO3\CMS\Core\Authentication\AbstractUserAuthentication;
+use TYPO3\CMS\Core\Site\Entity\SiteLanguage;
+
 class LanguageServiceFactory
 {
     /**
@@ -50,4 +50,17 @@ class LanguageServiceFactory
         $obj->init($locale);
         return $obj;
     }
+
+    public function createFromUserPreferences(?AbstractUserAuthentication $user): LanguageService
+    {
+        if ($user->user['lang'] ?? false) {
+            return $this->create($user->user['lang']);
+        }
+        return $this->create('default');
+    }
+
+    public function createFromSiteLanguage(SiteLanguage $language): LanguageService
+    {
+        return $this->create($language->getTypo3Language());
+    }
 }
diff --git a/typo3/sysext/core/Classes/ServiceProvider.php b/typo3/sysext/core/Classes/ServiceProvider.php
index 954a8c361020..37e1f1a5fa55 100644
--- a/typo3/sysext/core/Classes/ServiceProvider.php
+++ b/typo3/sysext/core/Classes/ServiceProvider.php
@@ -161,7 +161,8 @@ class ServiceProvider extends AbstractServiceProvider
             $container->get(Context\Context::class),
             $container->get(Console\CommandRegistry::class),
             $container->get(Configuration\ConfigurationManager::class),
-            $container->get(Core\BootService::class)
+            $container->get(Core\BootService::class),
+            $container->get(Localization\LanguageServiceFactory::class)
         );
     }
 
diff --git a/typo3/sysext/core/Configuration/Services.yaml b/typo3/sysext/core/Configuration/Services.yaml
index c070b3634e1f..5dc6ba4f572b 100644
--- a/typo3/sysext/core/Configuration/Services.yaml
+++ b/typo3/sysext/core/Configuration/Services.yaml
@@ -134,13 +134,16 @@ services:
         method: 'addCategoryDatabaseSchema'
 
   # @internal
-  # @todo: deprecate makeInstance(LanguageService::class)
   # This service entry is provided for legacy code that instantiates LanguageService
   # using GeneralUtility::makeInstance instead of the factory methods which itself
   # use LanguageServiceFactory (for install tool compatibility).
   TYPO3\CMS\Core\Localization\LanguageService:
     shared: false
     public: true
+    deprecated:
+      package: 'typo3/cms-core'
+      version: '11.3'
+      message: 'Injection/Instantiation of "%service_id%" is deprecated. Please use TYPO3\CMS\Core\Localization\LanguageServiceFactory->create().'
 
   TYPO3\CMS\Core\ExpressionLanguage\ProviderConfigurationLoader:
     public: true
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-94414-DeprecateLanguageServiceContainerEntry.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-94414-DeprecateLanguageServiceContainerEntry.rst
new file mode 100644
index 000000000000..d8c6af242bde
--- /dev/null
+++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-94414-DeprecateLanguageServiceContainerEntry.rst
@@ -0,0 +1,53 @@
+.. include:: ../../Includes.txt
+
+===============================================================
+Deprecation: #94414 - Deprecate LanguageService Container Entry
+===============================================================
+
+See :issue:`94414`
+
+Description
+===========
+
+Instances of :php:`TYPO3\CMS\Core\Localization\LanguageService` require
+custom initialization with a language key and additionally depend on core services.
+:php:`TYPO3\CMS\Core\Localization\LanguageServiceFactory` has therefore
+previously been introduced in order to manage this initialization.
+This replaced prior used instantiation via
+:php:`TYPO3\CMS\Core\Localization\LanguageService::create()` or
+:php:`GeneralUtility::makeInstance(LanguageService::class)`.
+
+
+Impact
+======
+
+Injecting :php:`TYPO3\CMS\Core\Localization\LanguageService` or creating
+instances via :php:`GeneralUtility::makeInstance(LanguageService::class)`,
+:php:`LanguageService::create()`, :php:`LanguageService::createFromUserPreferences()`
+or :php:`LanguageService::createFromSiteLanguage()` will trigger a
+PHP :php:`E_USER_DEPRECATED` error.
+
+
+Affected Installations
+======================
+
+Extensions injecting :php:`TYPO3\CMS\Core\Localization\LanguageService`
+or creating custom instances via :php:`GeneralUtility::makeInstance(LanguageService::class)`
+or :php:`TYPO3\CMS\Core\Localization\LanguageService::create()`.
+
+This is relatively unlikely since most usages are bootstrap related and
+extensions usually access the prepared LanguageService via :php:`GLOBALS['LANG']`
+in normal cases.
+
+Usages of :php:`LanguageService::create()`, :php:`LanguageService::createFromUserPreferences()`
+and :php:`LanguageService::createFromSiteLanguage()` are be found by the extension scanner
+as strong match.
+
+
+Migration
+=========
+
+The factory :php:`TYPO3\CMS\Core\Localization\LanguageServiceFactory`
+should be injected and used instead.
+
+.. index:: Backend, PHP-API, PartiallyScanned, ext:core
diff --git a/typo3/sysext/core/Tests/Functional/Authentication/Mfa/Provider/RecoveryCodesProviderTest.php b/typo3/sysext/core/Tests/Functional/Authentication/Mfa/Provider/RecoveryCodesProviderTest.php
index 6bb7ae0d0e27..85a31fd5cac6 100644
--- a/typo3/sysext/core/Tests/Functional/Authentication/Mfa/Provider/RecoveryCodesProviderTest.php
+++ b/typo3/sysext/core/Tests/Functional/Authentication/Mfa/Provider/RecoveryCodesProviderTest.php
@@ -27,7 +27,7 @@ use TYPO3\CMS\Core\Crypto\PasswordHashing\Argon2iPasswordHash;
 use TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory;
 use TYPO3\CMS\Core\Http\PropagateResponseException;
 use TYPO3\CMS\Core\Http\ServerRequest;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Messaging\FlashMessageService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
@@ -56,7 +56,7 @@ class RecoveryCodesProviderTest extends FunctionalTestCase
         parent::setUp();
         $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/core/Tests/Functional/Fixtures/be_users.xml');
         $this->user = $this->setUpBackendUser(1);
-        $GLOBALS['LANG'] = LanguageService::createFromUserPreferences($this->user);
+        $GLOBALS['LANG'] = $this->getContainer()->get(LanguageServiceFactory::class)->createFromUserPreferences($this->user);
         $this->subject = $this->getContainer()->get(MfaProviderRegistry::class)->getProvider('recovery-codes');
     }
 
diff --git a/typo3/sysext/core/Tests/Functional/Authentication/Mfa/Provider/TotpProviderTest.php b/typo3/sysext/core/Tests/Functional/Authentication/Mfa/Provider/TotpProviderTest.php
index cbab86ec8351..9465e19fd275 100644
--- a/typo3/sysext/core/Tests/Functional/Authentication/Mfa/Provider/TotpProviderTest.php
+++ b/typo3/sysext/core/Tests/Functional/Authentication/Mfa/Provider/TotpProviderTest.php
@@ -25,7 +25,7 @@ use TYPO3\CMS\Core\Authentication\Mfa\MfaViewType;
 use TYPO3\CMS\Core\Authentication\Mfa\Provider\Totp;
 use TYPO3\CMS\Core\Context\Context;
 use TYPO3\CMS\Core\Http\ServerRequest;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -39,7 +39,7 @@ class TotpProviderTest extends FunctionalTestCase
         parent::setUp();
         $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/core/Tests/Functional/Fixtures/be_users.xml');
         $this->user = $this->setUpBackendUser(1);
-        $GLOBALS['LANG'] = LanguageService::createFromUserPreferences($this->user);
+        $GLOBALS['LANG'] = $this->getContainer()->get(LanguageServiceFactory::class)->createFromUserPreferences($this->user);
         $this->subject = $this->getContainer()->get(MfaProviderRegistry::class)->getProvider('totp');
     }
 
diff --git a/typo3/sysext/core/Tests/Functional/Database/QueryGeneratorTest.php b/typo3/sysext/core/Tests/Functional/Database/QueryGeneratorTest.php
index 8c556ad73dfc..5f97cdcabe62 100644
--- a/typo3/sysext/core/Tests/Functional/Database/QueryGeneratorTest.php
+++ b/typo3/sysext/core/Tests/Functional/Database/QueryGeneratorTest.php
@@ -19,7 +19,7 @@ namespace TYPO3\CMS\Core\Tests\Functional\Database;
 
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\QueryGenerator;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -32,7 +32,7 @@ class QueryGeneratorTest extends FunctionalTestCase
     {
         parent::setUp();
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = LanguageService::create('default');
+        $GLOBALS['LANG'] = $this->getContainer()->get(LanguageServiceFactory::class)->create('default');
     }
 
     /**
diff --git a/typo3/sysext/core/Tests/Functional/Localization/LanguageServiceTest.php b/typo3/sysext/core/Tests/Functional/Localization/LanguageServiceTest.php
index 2689b83c833b..50c668d950ce 100644
--- a/typo3/sysext/core/Tests/Functional/Localization/LanguageServiceTest.php
+++ b/typo3/sysext/core/Tests/Functional/Localization/LanguageServiceTest.php
@@ -18,19 +18,17 @@ declare(strict_types=1);
 namespace TYPO3\CMS\Core\Tests\Functional\Localization;
 
 use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
 class LanguageServiceTest extends FunctionalTestCase
 {
-    /**
-     * @var LanguageService
-     */
-    protected $subject;
+    protected LanguageService $subject;
 
     protected function setUp(): void
     {
         parent::setUp();
-        $this->subject = LanguageService::create('default');
+        $this->subject = $this->getContainer()->get(LanguageServiceFactory::class)->create('default');
     }
 
     /**
diff --git a/typo3/sysext/core/Tests/Functional/Page/PageRendererTest.php b/typo3/sysext/core/Tests/Functional/Page/PageRendererTest.php
index dfc447d50969..4225dea0d46e 100644
--- a/typo3/sysext/core/Tests/Functional/Page/PageRendererTest.php
+++ b/typo3/sysext/core/Tests/Functional/Page/PageRendererTest.php
@@ -21,7 +21,7 @@ use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Authentication\IpLocker;
 use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder;
 use TYPO3\CMS\Core\Http\ServerRequest;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Session\Backend\SessionBackendInterface;
 use TYPO3\CMS\Core\Session\UserSessionManager;
@@ -323,7 +323,7 @@ class PageRendererTest extends FunctionalTestCase
         $GLOBALS['BE_USER']->user = ['uid' => 1];
         $GLOBALS['BE_USER']->setLogger(new NullLogger());
 
-        $GLOBALS['LANG'] = LanguageService::createFromUserPreferences($GLOBALS['BE_USER']);
+        $GLOBALS['LANG'] = $this->getContainer()->get(LanguageServiceFactory::class)->createFromUserPreferences($GLOBALS['BE_USER']);
 
         $GLOBALS['TYPO3_REQUEST'] = (new ServerRequest())
             ->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE);
diff --git a/typo3/sysext/core/Tests/Functional/Tca/BackendGroupsVisibleFieldsTest.php b/typo3/sysext/core/Tests/Functional/Tca/BackendGroupsVisibleFieldsTest.php
index 310b2161d72b..f2628bf44102 100644
--- a/typo3/sysext/core/Tests/Functional/Tca/BackendGroupsVisibleFieldsTest.php
+++ b/typo3/sysext/core/Tests/Functional/Tca/BackendGroupsVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Core\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -48,7 +48,7 @@ class BackendGroupsVisibleFieldsTest extends FunctionalTestCase
     public function backendGroupsFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('be_groups');
diff --git a/typo3/sysext/core/Tests/Functional/Tca/BackendUsersVisibleFieldsTest.php b/typo3/sysext/core/Tests/Functional/Tca/BackendUsersVisibleFieldsTest.php
index 53413cab13b2..25eae0b0c56a 100644
--- a/typo3/sysext/core/Tests/Functional/Tca/BackendUsersVisibleFieldsTest.php
+++ b/typo3/sysext/core/Tests/Functional/Tca/BackendUsersVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Core\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -64,7 +64,7 @@ class BackendUsersVisibleFieldsTest extends FunctionalTestCase
     public function backendUsersFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('be_users');
@@ -90,7 +90,7 @@ class BackendUsersVisibleFieldsTest extends FunctionalTestCase
     public function backendUsersFormContainsExpectedFieldsForAdmins()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('be_users', ['admin' => true]);
diff --git a/typo3/sysext/core/Tests/Functional/Tca/CategoryVisibleFieldsTest.php b/typo3/sysext/core/Tests/Functional/Tca/CategoryVisibleFieldsTest.php
index bd2ebe9181d4..829cb2ae3cf4 100644
--- a/typo3/sysext/core/Tests/Functional/Tca/CategoryVisibleFieldsTest.php
+++ b/typo3/sysext/core/Tests/Functional/Tca/CategoryVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Core\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -39,7 +39,7 @@ class CategoryVisibleFieldsTest extends FunctionalTestCase
     public function categoryFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('sys_category');
diff --git a/typo3/sysext/core/Tests/Functional/Tca/FileCollectionVisibleFieldsTest.php b/typo3/sysext/core/Tests/Functional/Tca/FileCollectionVisibleFieldsTest.php
index d3a5c34b3dd3..26a946ea7760 100644
--- a/typo3/sysext/core/Tests/Functional/Tca/FileCollectionVisibleFieldsTest.php
+++ b/typo3/sysext/core/Tests/Functional/Tca/FileCollectionVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Core\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -47,7 +47,7 @@ class FileCollectionVisibleFieldsTest extends FunctionalTestCase
     public function fileCollectionFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
 
diff --git a/typo3/sysext/core/Tests/Functional/Tca/FileMetadataVisibleFieldsTest.php b/typo3/sysext/core/Tests/Functional/Tca/FileMetadataVisibleFieldsTest.php
index d9a62eeeae6a..2d831aeab9d4 100644
--- a/typo3/sysext/core/Tests/Functional/Tca/FileMetadataVisibleFieldsTest.php
+++ b/typo3/sysext/core/Tests/Functional/Tca/FileMetadataVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Core\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -35,7 +35,7 @@ class FileMetadataVisibleFieldsTest extends FunctionalTestCase
     public function fileMetadataFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('sys_file_metadata');
diff --git a/typo3/sysext/core/Tests/Functional/Tca/FileStorageVisibleFieldsTest.php b/typo3/sysext/core/Tests/Functional/Tca/FileStorageVisibleFieldsTest.php
index b32a79a3abe7..0b02dd2a56cc 100644
--- a/typo3/sysext/core/Tests/Functional/Tca/FileStorageVisibleFieldsTest.php
+++ b/typo3/sysext/core/Tests/Functional/Tca/FileStorageVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Core\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -41,7 +41,7 @@ class FileStorageVisibleFieldsTest extends FunctionalTestCase
     public function fileStorageFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('sys_file_storage');
diff --git a/typo3/sysext/core/Tests/Functional/Tca/FilemountsVisibleFieldsTest.php b/typo3/sysext/core/Tests/Functional/Tca/FilemountsVisibleFieldsTest.php
index 5292db669066..a7afc425ca4d 100644
--- a/typo3/sysext/core/Tests/Functional/Tca/FilemountsVisibleFieldsTest.php
+++ b/typo3/sysext/core/Tests/Functional/Tca/FilemountsVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Core\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -37,7 +37,7 @@ class FilemountsVisibleFieldsTest extends FunctionalTestCase
     public function filemountsFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('sys_filemounts', ['base' => 1]);
diff --git a/typo3/sysext/core/Tests/Functional/Tca/LanguageVisibleFieldsTest.php b/typo3/sysext/core/Tests/Functional/Tca/LanguageVisibleFieldsTest.php
index 8c20dd795907..944c7e35737e 100644
--- a/typo3/sysext/core/Tests/Functional/Tca/LanguageVisibleFieldsTest.php
+++ b/typo3/sysext/core/Tests/Functional/Tca/LanguageVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Core\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -35,7 +35,7 @@ class LanguageVisibleFieldsTest extends FunctionalTestCase
     public function languageFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('sys_language', ['base' => 1]);
diff --git a/typo3/sysext/core/Tests/Functional/Tca/NewsVisibleFieldsTest.php b/typo3/sysext/core/Tests/Functional/Tca/NewsVisibleFieldsTest.php
index 6af887e17d0a..fa34b1e04ab4 100644
--- a/typo3/sysext/core/Tests/Functional/Tca/NewsVisibleFieldsTest.php
+++ b/typo3/sysext/core/Tests/Functional/Tca/NewsVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Core\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -36,7 +36,7 @@ class NewsVisibleFieldsTest extends FunctionalTestCase
     public function newsFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('sys_news');
diff --git a/typo3/sysext/core/Tests/Functional/Tca/PagesVisibleFieldsTest.php b/typo3/sysext/core/Tests/Functional/Tca/PagesVisibleFieldsTest.php
index dbd8ad3515a5..536ac1f85d24 100644
--- a/typo3/sysext/core/Tests/Functional/Tca/PagesVisibleFieldsTest.php
+++ b/typo3/sysext/core/Tests/Functional/Tca/PagesVisibleFieldsTest.php
@@ -17,7 +17,7 @@ namespace TYPO3\CMS\Core\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
 use TYPO3\CMS\Core\Domain\Repository\PageRepository;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -240,7 +240,7 @@ class PagesVisibleFieldsTest extends FunctionalTestCase
     public function pagesFormContainsExpectedFields(int $doktype, array $expectedFields, array $hiddenFields)
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('pages', ['doktype' => $doktype]);
diff --git a/typo3/sysext/extbase/Tests/Functional/Mvc/Validation/ActionControllerValidationTest.php b/typo3/sysext/extbase/Tests/Functional/Mvc/Validation/ActionControllerValidationTest.php
index b0047104a486..b8de42325da1 100644
--- a/typo3/sysext/extbase/Tests/Functional/Mvc/Validation/ActionControllerValidationTest.php
+++ b/typo3/sysext/extbase/Tests/Functional/Mvc/Validation/ActionControllerValidationTest.php
@@ -17,7 +17,7 @@ namespace TYPO3\CMS\Extbase\Tests\Functional\Mvc\Validation;
 
 use ExtbaseTeam\BlogExample\Controller\BlogController;
 use TYPO3\CMS\Core\Http\Response;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Extbase\Error\Error;
 use TYPO3\CMS\Extbase\Error\Result;
 use TYPO3\CMS\Extbase\Http\ForwardResponse;
@@ -68,7 +68,7 @@ class ActionControllerValidationTest extends FunctionalTestCase
      */
     public function forwardedActionValidatesPreviouslyIgnoredArgument(array $blogPostArgument, array $trustedProperties, array $expectedErrorCodes)
     {
-        $GLOBALS['LANG'] = $this->getContainer()->get(LanguageService::class);
+        $GLOBALS['LANG'] = $this->getContainer()->get(LanguageServiceFactory::class)->create('default');
         $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] = 'testkey';
 
         $this->importDataSet('PACKAGE:typo3/testing-framework/Resources/Core/Functional/Fixtures/pages.xml');
@@ -119,7 +119,7 @@ class ActionControllerValidationTest extends FunctionalTestCase
      */
     public function validationResultsAreProvidedForTheSameObjectInDifferentArguments()
     {
-        $GLOBALS['LANG'] = $this->getContainer()->get(LanguageService::class);
+        $GLOBALS['LANG'] = $this->getContainer()->get(LanguageServiceFactory::class)->create('default');
         $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] = 'testkey';
 
         $this->importDataSet('PACKAGE:typo3/testing-framework/Resources/Core/Functional/Fixtures/pages.xml');
diff --git a/typo3/sysext/extbase/Tests/Functional/Validation/Validator/RegularExpressionValidatorTest.php b/typo3/sysext/extbase/Tests/Functional/Validation/Validator/RegularExpressionValidatorTest.php
index 1a11f8c1273c..6db225267e23 100644
--- a/typo3/sysext/extbase/Tests/Functional/Validation/Validator/RegularExpressionValidatorTest.php
+++ b/typo3/sysext/extbase/Tests/Functional/Validation/Validator/RegularExpressionValidatorTest.php
@@ -4,7 +4,7 @@ declare(strict_types=1);
 
 namespace TYPO3\CMS\Extbase\Tests\Functional\Validation\Validator;
 
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Extbase\Validation\Error;
 use TYPO3\CMS\Extbase\Validation\Exception\InvalidValidationOptionsException;
 use TYPO3\CMS\Extbase\Validation\Validator\RegularExpressionValidator;
@@ -15,7 +15,7 @@ class RegularExpressionValidatorTest extends FunctionalTestCase
     protected function setUp(): void
     {
         parent::setUp();
-        $GLOBALS['LANG'] = LanguageService::create('default');
+        $GLOBALS['LANG'] = $this->getContainer()->get(LanguageServiceFactory::class)->create('default');
     }
 
     public function customErrorMessagesDataProvider(): array
diff --git a/typo3/sysext/extensionmanager/Classes/Report/ExtensionStatus.php b/typo3/sysext/extensionmanager/Classes/Report/ExtensionStatus.php
index e5e759e01d13..faf6c081bafe 100644
--- a/typo3/sysext/extensionmanager/Classes/Report/ExtensionStatus.php
+++ b/typo3/sysext/extensionmanager/Classes/Report/ExtensionStatus.php
@@ -16,6 +16,7 @@
 namespace TYPO3\CMS\Extensionmanager\Report;
 
 use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
 use TYPO3\CMS\Extensionmanager\Remote\RemoteRegistry;
@@ -67,7 +68,8 @@ class ExtensionStatus implements StatusProviderInterface
     {
         $this->remoteRegistry = $remoteRegistry ?? GeneralUtility::makeInstance(RemoteRegistry::class);
         $this->listUtility = GeneralUtility::makeInstance(ListUtility::class);
-        $this->languageService = $languageService ?? LanguageService::createFromUserPreferences($GLOBALS['BE_USER'] ?? null);
+
+        $this->languageService = $languageService ?? GeneralUtility::makeInstance(LanguageServiceFactory::class)->createFromUserPreferences($GLOBALS['BE_USER'] ?? null);
         $this->languageService->includeLLFile('EXT:extensionmanager/Resources/Private/Language/locallang.xlf');
     }
 
diff --git a/typo3/sysext/felogin/Tests/Functional/Tca/ContentVisibleFieldsTest.php b/typo3/sysext/felogin/Tests/Functional/Tca/ContentVisibleFieldsTest.php
index 828eeb71b095..203138e8b671 100644
--- a/typo3/sysext/felogin/Tests/Functional/Tca/ContentVisibleFieldsTest.php
+++ b/typo3/sysext/felogin/Tests/Functional/Tca/ContentVisibleFieldsTest.php
@@ -18,7 +18,7 @@ declare(strict_types=1);
 namespace TYPO3\CMS\FrontendLogin\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -55,7 +55,7 @@ class ContentVisibleFieldsTest extends FunctionalTestCase
     public function loginFormContainsExpectedFields(): void
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('tt_content', ['CType' => 'felogin_login']);
diff --git a/typo3/sysext/filemetadata/Tests/Functional/Tca/FileMetadataVisibleFieldsTest.php b/typo3/sysext/filemetadata/Tests/Functional/Tca/FileMetadataVisibleFieldsTest.php
index 3903e1007a03..623f53157410 100644
--- a/typo3/sysext/filemetadata/Tests/Functional/Tca/FileMetadataVisibleFieldsTest.php
+++ b/typo3/sysext/filemetadata/Tests/Functional/Tca/FileMetadataVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Filemetadata\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Resource\File;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
@@ -149,7 +149,7 @@ class FileMetadataVisibleFieldsTest extends FunctionalTestCase
     public function fileMetadataFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
         $GLOBALS['TCA']['sys_file_metadata']['ctrl']['type'] = 'fileype';
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
diff --git a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Be/Labels/CshViewHelperTest.php b/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Be/Labels/CshViewHelperTest.php
index 480a4f529810..633fe1e32440 100644
--- a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Be/Labels/CshViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Be/Labels/CshViewHelperTest.php
@@ -17,7 +17,7 @@ declare(strict_types=1);
 
 namespace TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers\Be\Labels;
 
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\View\StandaloneView;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
@@ -28,7 +28,7 @@ class CshViewHelperTest extends FunctionalTestCase
     {
         parent::setUp();
         if (!isset($GLOBALS['LANG'])) {
-            $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+            $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
         }
     }
 
diff --git a/typo3/sysext/fluid_styled_content/Tests/Functional/Tca/ContentVisibleFieldsTest.php b/typo3/sysext/fluid_styled_content/Tests/Functional/Tca/ContentVisibleFieldsTest.php
index 3a8465d5dae7..17cd57176121 100644
--- a/typo3/sysext/fluid_styled_content/Tests/Functional/Tca/ContentVisibleFieldsTest.php
+++ b/typo3/sysext/fluid_styled_content/Tests/Functional/Tca/ContentVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\FluidStyledContent\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -64,7 +64,7 @@ class ContentVisibleFieldsTest extends FunctionalTestCase
     public function contentFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
 
diff --git a/typo3/sysext/form/Classes/Domain/Configuration/FlexformConfiguration/Processors/FinisherOptionGenerator.php b/typo3/sysext/form/Classes/Domain/Configuration/FlexformConfiguration/Processors/FinisherOptionGenerator.php
index 1f71e5e58758..54d59dc26c2d 100644
--- a/typo3/sysext/form/Classes/Domain/Configuration/FlexformConfiguration/Processors/FinisherOptionGenerator.php
+++ b/typo3/sysext/form/Classes/Domain/Configuration/FlexformConfiguration/Processors/FinisherOptionGenerator.php
@@ -17,7 +17,7 @@ declare(strict_types=1);
 
 namespace TYPO3\CMS\Form\Domain\Configuration\FlexformConfiguration\Processors;
 
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\ArrayUtility;
 use TYPO3\CMS\Core\Utility\Exception\MissingArrayPathException;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -30,7 +30,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
 class FinisherOptionGenerator extends AbstractProcessor
 {
     /**
-     * @var \TYPO3\CMS\Core\Localization\LanguageService
+     * @var \TYPO3\CMS\Core\Localization\LanguageServiceFactory
      */
     protected $languageService;
 
@@ -41,7 +41,7 @@ class FinisherOptionGenerator extends AbstractProcessor
     {
         parent::__construct($converterDto);
 
-        $this->languageService = GeneralUtility::makeInstance(LanguageService::class);
+        $this->languageService = GeneralUtility::makeInstance(LanguageServiceFactory::class);
         $this->languageService->includeLLFile('EXT:form/Resources/Private/Language/Database.xlf');
     }
 
diff --git a/typo3/sysext/form/Tests/Functional/Mvc/Validation/MimeTypeValidatorTest.php b/typo3/sysext/form/Tests/Functional/Mvc/Validation/MimeTypeValidatorTest.php
index aeac8ea83cbc..3471c0b6d7e2 100644
--- a/typo3/sysext/form/Tests/Functional/Mvc/Validation/MimeTypeValidatorTest.php
+++ b/typo3/sysext/form/Tests/Functional/Mvc/Validation/MimeTypeValidatorTest.php
@@ -19,7 +19,7 @@ namespace TYPO3\CMS\Form\Tests\Functional\Mvc\Validation;
 
 use org\bovigo\vfs\vfsStream;
 use org\bovigo\vfs\vfsStreamDirectory;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Error\Error;
 use TYPO3\CMS\Form\Mvc\Property\TypeConverter\PseudoFile;
@@ -54,7 +54,7 @@ class MimeTypeValidatorTest extends FunctionalTestCase
     protected function setUp(): void
     {
         parent::setUp();
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
         $this->tmp = vfsStream::setup('tmp', null, $this->files);
     }
 
diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
index 538be356ef25..ae914c1f61f3 100644
--- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
+++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
@@ -48,6 +48,7 @@ use TYPO3\CMS\Core\Http\NormalizedParams;
 use TYPO3\CMS\Core\Http\PropagateResponseException;
 use TYPO3\CMS\Core\Http\ServerRequestFactory;
 use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Locking\Exception\LockAcquireWouldBlockException;
 use TYPO3\CMS\Core\Locking\LockFactory;
 use TYPO3\CMS\Core\Locking\LockingStrategyInterface;
@@ -3202,7 +3203,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
      */
     protected function setOutputLanguage()
     {
-        $this->languageService = LanguageService::createFromSiteLanguage($this->language);
+        $this->languageService = GeneralUtility::makeInstance(LanguageServiceFactory::class)->createFromSiteLanguage($this->language);
         // Always disable debugging for TSFE
         $this->languageService->debugKey = false;
     }
diff --git a/typo3/sysext/frontend/Classes/Middleware/BackendUserAuthenticator.php b/typo3/sysext/frontend/Classes/Middleware/BackendUserAuthenticator.php
index 6a601f2c0f7c..b00d2ee9f35b 100644
--- a/typo3/sysext/frontend/Classes/Middleware/BackendUserAuthenticator.php
+++ b/typo3/sysext/frontend/Classes/Middleware/BackendUserAuthenticator.php
@@ -23,9 +23,10 @@ use Psr\Http\Server\RequestHandlerInterface;
 use TYPO3\CMS\Backend\FrontendBackendUserAuthentication;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Authentication\Mfa\MfaRequiredException;
+use TYPO3\CMS\Core\Context\Context;
 use TYPO3\CMS\Core\Core\Bootstrap;
 use TYPO3\CMS\Core\Http\NormalizedParams;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -38,6 +39,16 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
  */
 class BackendUserAuthenticator extends \TYPO3\CMS\Core\Middleware\BackendUserAuthenticator
 {
+    private LanguageServiceFactory $languageServiceFactory;
+
+    public function __construct(
+        Context $context,
+        LanguageServiceFactory $languageServiceFactory
+    ) {
+        parent::__construct($context);
+        $this->languageServiceFactory = $languageServiceFactory;
+    }
+
     /**
      * Creates a backend user authentication object, tries to authenticate a user
      *
@@ -59,7 +70,7 @@ class BackendUserAuthenticator extends \TYPO3\CMS\Core\Middleware\BackendUserAut
         // like $GLOBALS['LANG'] for labels in the language of the BE User, the router, and ext_tables.php for all modules
         // So things like Frontend Editing and Admin Panel can use this for generating links to the TYPO3 Backend.
         if ($GLOBALS['BE_USER'] instanceof FrontendBackendUserAuthentication) {
-            $GLOBALS['LANG'] = LanguageService::createFromUserPreferences($GLOBALS['BE_USER']);
+            $GLOBALS['LANG'] = $this->languageServiceFactory->createFromUserPreferences($GLOBALS['BE_USER']);
             Bootstrap::loadExtTables();
             $this->setBackendUserAspect($GLOBALS['BE_USER']);
         }
diff --git a/typo3/sysext/frontend/Tests/Functional/Tca/BackendLayoutVisibleFieldsTest.php b/typo3/sysext/frontend/Tests/Functional/Tca/BackendLayoutVisibleFieldsTest.php
index 6c0a208df4b0..44b4d67fa76d 100644
--- a/typo3/sysext/frontend/Tests/Functional/Tca/BackendLayoutVisibleFieldsTest.php
+++ b/typo3/sysext/frontend/Tests/Functional/Tca/BackendLayoutVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Frontend\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -36,7 +36,7 @@ class BackendLayoutVisibleFieldsTest extends FunctionalTestCase
     public function backendLayoutsFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('backend_layout');
diff --git a/typo3/sysext/frontend/Tests/Functional/Tca/ContentVisibleFieldsTest.php b/typo3/sysext/frontend/Tests/Functional/Tca/ContentVisibleFieldsTest.php
index 85488d1d21c6..769aaa4fd12c 100644
--- a/typo3/sysext/frontend/Tests/Functional/Tca/ContentVisibleFieldsTest.php
+++ b/typo3/sysext/frontend/Tests/Functional/Tca/ContentVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Frontend\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -116,7 +116,7 @@ class ContentVisibleFieldsTest extends FunctionalTestCase
     public function contentFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
 
diff --git a/typo3/sysext/frontend/Tests/Functional/Tca/FrontendGroupsVisibleFieldsTest.php b/typo3/sysext/frontend/Tests/Functional/Tca/FrontendGroupsVisibleFieldsTest.php
index 495bcb8fcc68..1effd2960037 100644
--- a/typo3/sysext/frontend/Tests/Functional/Tca/FrontendGroupsVisibleFieldsTest.php
+++ b/typo3/sysext/frontend/Tests/Functional/Tca/FrontendGroupsVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Frontend\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -37,7 +37,7 @@ class FrontendGroupsVisibleFieldsTest extends FunctionalTestCase
     public function frontendGroupsFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('fe_groups');
diff --git a/typo3/sysext/frontend/Tests/Functional/Tca/FrontendUsersVisibleFieldsTest.php b/typo3/sysext/frontend/Tests/Functional/Tca/FrontendUsersVisibleFieldsTest.php
index 742f632c39f4..130ebad4d24f 100644
--- a/typo3/sysext/frontend/Tests/Functional/Tca/FrontendUsersVisibleFieldsTest.php
+++ b/typo3/sysext/frontend/Tests/Functional/Tca/FrontendUsersVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Frontend\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -54,7 +54,7 @@ class FrontendUsersVisibleFieldsTest extends FunctionalTestCase
     public function frontendUsersFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('fe_users');
diff --git a/typo3/sysext/frontend/Tests/Functional/Tca/PagesLanguageOverlayVisibleFieldsTest.php b/typo3/sysext/frontend/Tests/Functional/Tca/PagesLanguageOverlayVisibleFieldsTest.php
index ce76a1fb7781..5df9f06d770f 100644
--- a/typo3/sysext/frontend/Tests/Functional/Tca/PagesLanguageOverlayVisibleFieldsTest.php
+++ b/typo3/sysext/frontend/Tests/Functional/Tca/PagesLanguageOverlayVisibleFieldsTest.php
@@ -17,7 +17,7 @@ namespace TYPO3\CMS\Frontend\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
 use TYPO3\CMS\Core\Domain\Repository\PageRepository;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -165,7 +165,7 @@ class PagesLanguageOverlayVisibleFieldsTest extends FunctionalTestCase
         array $hiddenFields
     ) {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('pages', ['doktype' => $doktype]);
diff --git a/typo3/sysext/frontend/Tests/Functional/Tca/TemplateVisibleFieldsTest.php b/typo3/sysext/frontend/Tests/Functional/Tca/TemplateVisibleFieldsTest.php
index cf9157d1b416..4493316a8fa9 100644
--- a/typo3/sysext/frontend/Tests/Functional/Tca/TemplateVisibleFieldsTest.php
+++ b/typo3/sysext/frontend/Tests/Functional/Tca/TemplateVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Frontend\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -44,7 +44,7 @@ class TemplateVisibleFieldsTest extends FunctionalTestCase
     public function templateFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('sys_template');
diff --git a/typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/AbstractMenuContentObjectTest.php b/typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/AbstractMenuContentObjectTest.php
index fe2fa637019d..826e0a1d3270 100644
--- a/typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/AbstractMenuContentObjectTest.php
+++ b/typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/AbstractMenuContentObjectTest.php
@@ -82,7 +82,7 @@ class AbstractMenuContentObjectTest extends UnitTestCase
         $cacheFrontendProphecy->set(Argument::cetera())->willReturn(null);
         $languageService = new LanguageService(new Locales(), new LocalizationFactory(new LanguageStore(), $cacheManagerProphecy->reveal()));
         $languageServiceFactoryProphecy = $this->prophesize(LanguageServiceFactory::class);
-        $languageServiceFactoryProphecy->create(Argument::any())->willReturn($languageService);
+        $languageServiceFactoryProphecy->createFromSiteLanguage(Argument::any())->willReturn($languageService);
         GeneralUtility::addInstance(LanguageServiceFactory::class, $languageServiceFactoryProphecy->reveal());
         $frontendUserProphecy = $this->prophesize(FrontendUserAuthentication::class);
         $GLOBALS['TSFE'] = $this->getMockBuilder(TypoScriptFrontendController::class)
diff --git a/typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php b/typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php
index bcb675a9e293..22dbacd4e354 100644
--- a/typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php
+++ b/typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php
@@ -38,6 +38,7 @@ use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\PageTitle\PageTitleProviderManager;
 use TYPO3\CMS\Core\Routing\PageArguments;
 use TYPO3\CMS\Core\Site\Entity\Site;
+use TYPO3\CMS\Core\Site\Entity\SiteLanguage;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\StringUtility;
 use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication;
@@ -161,8 +162,8 @@ class TypoScriptFrontendControllerTest extends UnitTestCase
         $cacheManager->getCache('l10n')->willReturn($nullCacheBackend);
         $languageService = new LanguageService(new Locales(), new LocalizationFactory(new LanguageStore(), $cacheManager->reveal()));
         $languageServiceFactoryProphecy = $this->prophesize(LanguageServiceFactory::class);
-        $languageServiceFactoryProphecy->create(Argument::any())->will(function ($args) use ($languageService) {
-            $languageService->init($args[0]);
+        $languageServiceFactoryProphecy->createFromSiteLanguage(Argument::type(SiteLanguage::class))->will(function ($args) use ($languageService) {
+            $languageService->init($args[0]->getTypo3Language());
             return $languageService;
         });
         GeneralUtility::addInstance(LanguageServiceFactory::class, $languageServiceFactoryProphecy->reveal());
@@ -571,8 +572,8 @@ class TypoScriptFrontendControllerTest extends UnitTestCase
         ]);
         $languageService = new LanguageService(new Locales(), new LocalizationFactory(new LanguageStore(), $cacheManager->reveal()));
         $languageServiceFactoryProphecy = $this->prophesize(LanguageServiceFactory::class);
-        $languageServiceFactoryProphecy->create(Argument::any())->will(function ($args) use ($languageService) {
-            $languageService->init($args[0]);
+        $languageServiceFactoryProphecy->createFromSiteLanguage(Argument::type(SiteLanguage::class))->will(function ($args) use ($languageService) {
+            $languageService->init($args[0]->getTypo3Language());
             return $languageService;
         });
         GeneralUtility::addInstance(LanguageServiceFactory::class, $languageServiceFactoryProphecy->reveal());
@@ -607,8 +608,8 @@ class TypoScriptFrontendControllerTest extends UnitTestCase
         ]);
         $languageService = new LanguageService(new Locales(), new LocalizationFactory(new LanguageStore(), $cacheManager->reveal()));
         $languageServiceFactoryProphecy = $this->prophesize(LanguageServiceFactory::class);
-        $languageServiceFactoryProphecy->create(Argument::any())->will(function ($args) use ($languageService) {
-            $languageService->init($args[0]);
+        $languageServiceFactoryProphecy->createFromSiteLanguage(Argument::type(SiteLanguage::class))->will(function ($args) use ($languageService) {
+            $languageService->init($args[0]->getTypo3Language());
             return $languageService;
         });
         GeneralUtility::addInstance(LanguageServiceFactory::class, $languageServiceFactoryProphecy->reveal());
@@ -642,8 +643,8 @@ class TypoScriptFrontendControllerTest extends UnitTestCase
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManager->reveal());
         $languageService = new LanguageService(new Locales(), new LocalizationFactory(new LanguageStore(), $cacheManager->reveal()));
         $languageServiceFactoryProphecy = $this->prophesize(LanguageServiceFactory::class);
-        $languageServiceFactoryProphecy->create(Argument::any())->will(function ($args) use ($languageService) {
-            $languageService->init($args[0]);
+        $languageServiceFactoryProphecy->createFromSiteLanguage(Argument::type(SiteLanguage::class))->will(function ($args) use ($languageService) {
+            $languageService->init($args[0]->getTypo3Language());
             return $languageService;
         });
         GeneralUtility::addInstance(LanguageServiceFactory::class, $languageServiceFactoryProphecy->reveal());
diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php
index 646ecfb71e84..c98cbc8b05c9 100644
--- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php
+++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php
@@ -1114,4 +1114,25 @@ return [
             'Deprecation-94316-DeprecatedHTTPHeaderManipulatingMethodsFromHttpUtility.rst'
         ],
     ],
+    'TYPO3\CMS\Core\Localization\LanguageService::create' => [
+        'numberOfMandatoryArguments' => 1,
+        'maximumNumberOfArguments' => 1,
+        'restFiles' => [
+            'Deprecation-94414-DeprecateLanguageServiceContainerEntry.rst'
+        ],
+    ],
+    'TYPO3\CMS\Core\Localization\LanguageService::createFromUserPreferences' => [
+        'numberOfMandatoryArguments' => 1,
+        'maximumNumberOfArguments' => 1,
+        'restFiles' => [
+            'Deprecation-94414-DeprecateLanguageServiceContainerEntry.rst'
+        ],
+    ],
+    'TYPO3\CMS\Core\Localization\LanguageService::createFromSiteLanguage' => [
+        'numberOfMandatoryArguments' => 1,
+        'maximumNumberOfArguments' => 1,
+        'restFiles' => [
+            'Deprecation-94414-DeprecateLanguageServiceContainerEntry.rst'
+        ],
+    ],
 ];
diff --git a/typo3/sysext/linkvalidator/Tests/Functional/LinkAnalyzerTest.php b/typo3/sysext/linkvalidator/Tests/Functional/LinkAnalyzerTest.php
index 81ea622a61c3..6feed7121eef 100644
--- a/typo3/sysext/linkvalidator/Tests/Functional/LinkAnalyzerTest.php
+++ b/typo3/sysext/linkvalidator/Tests/Functional/LinkAnalyzerTest.php
@@ -18,7 +18,7 @@ declare(strict_types=1);
 namespace TYPO3\CMS\Linkvalidator\Tests\Functional;
 
 use Psr\EventDispatcher\EventDispatcherInterface;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Linkvalidator\LinkAnalyzer;
 use TYPO3\CMS\Linkvalidator\Repository\BrokenLinkRepository;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
@@ -37,7 +37,7 @@ class LinkAnalyzerTest extends FunctionalTestCase
     protected function setUp(): void
     {
         parent::setUp();
-        $GLOBALS['LANG'] = LanguageService::create('default');
+        $GLOBALS['LANG'] = $this->getContainer()->get(LanguageServiceFactory::class)->create('default');
     }
 
     public function findAllBrokenLinksDataProvider(): array
diff --git a/typo3/sysext/recordlist/Tests/Functional/RecordList/CsvExportRecordListTest.php b/typo3/sysext/recordlist/Tests/Functional/RecordList/CsvExportRecordListTest.php
index 46d34e9ec0cb..25f8a14e8b0b 100644
--- a/typo3/sysext/recordlist/Tests/Functional/RecordList/CsvExportRecordListTest.php
+++ b/typo3/sysext/recordlist/Tests/Functional/RecordList/CsvExportRecordListTest.php
@@ -19,7 +19,7 @@ namespace TYPO3\CMS\Recordlist\Tests\Functional\RecordList;
 
 use TYPO3\CMS\Backend\Configuration\TranslationConfigurationProvider;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Recordlist\RecordList\CsvExportRecordList;
 use TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
@@ -32,7 +32,7 @@ class CsvExportRecordListTest extends FunctionalTestCase
     {
         parent::setUp();
         $this->user = parent::setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = LanguageService::createFromUserPreferences($this->user);
+        $GLOBALS['LANG'] = $this->getContainer()->get(LanguageServiceFactory::class)->createFromUserPreferences($this->user);
     }
 
     /**
diff --git a/typo3/sysext/redirects/Tests/Functional/Service/SlugServiceTest.php b/typo3/sysext/redirects/Tests/Functional/Service/SlugServiceTest.php
index 9c9527c25ddd..b8ea6a028c67 100644
--- a/typo3/sysext/redirects/Tests/Functional/Service/SlugServiceTest.php
+++ b/typo3/sysext/redirects/Tests/Functional/Service/SlugServiceTest.php
@@ -22,7 +22,7 @@ use TYPO3\CMS\Core\Configuration\SiteConfiguration;
 use TYPO3\CMS\Core\Context\Context;
 use TYPO3\CMS\Core\DataHandling\Model\CorrelationId;
 use TYPO3\CMS\Core\Domain\Repository\PageRepository;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Routing\SiteMatcher;
 use TYPO3\CMS\Core\Site\SiteFinder;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -374,7 +374,7 @@ class SlugServiceTest extends FunctionalTestCase
         GeneralUtility::makeInstance(SiteMatcher::class)->refresh();
         $this->subject = new SlugService(
             GeneralUtility::makeInstance(Context::class),
-            GeneralUtility::makeInstance(LanguageService::class),
+            GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default'),
             GeneralUtility::makeInstance(SiteFinder::class),
             GeneralUtility::makeInstance(PageRepository::class)
         );
diff --git a/typo3/sysext/rte_ckeditor/Classes/Controller/BrowseLinksController.php b/typo3/sysext/rte_ckeditor/Classes/Controller/BrowseLinksController.php
index 83171f04da28..eeca738c350a 100644
--- a/typo3/sysext/rte_ckeditor/Classes/Controller/BrowseLinksController.php
+++ b/typo3/sysext/rte_ckeditor/Classes/Controller/BrowseLinksController.php
@@ -20,6 +20,7 @@ namespace TYPO3\CMS\RteCKEditor\Controller;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Core\Configuration\Richtext;
 use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Recordlist\Controller\AbstractLinkBrowserController;
 
@@ -104,7 +105,7 @@ class BrowseLinksController extends AbstractLinkBrowserController
     protected function init()
     {
         parent::init();
-        $this->contentLanguageService = GeneralUtility::makeInstance(LanguageService::class);
+        $this->contentLanguageService = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
     }
 
     /**
@@ -122,7 +123,7 @@ class BrowseLinksController extends AbstractLinkBrowserController
         $this->editorId = $queryParameters['editorId'];
         $this->contentsLanguage = $queryParameters['contentsLanguage'];
 
-        $this->contentLanguageService = LanguageService::create($this->contentsLanguage);
+        $this->contentLanguageService = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create($this->contentsLanguage);
 
         $tcaFieldConf = ['enableRichtext' => true];
         if (!empty($queryParameters['P']['richtextConfigurationName'])) {
diff --git a/typo3/sysext/scheduler/Tests/Functional/Tca/TaskGroupVisibleFieldsTest.php b/typo3/sysext/scheduler/Tests/Functional/Tca/TaskGroupVisibleFieldsTest.php
index 329ab373a8b5..3d776b84d16b 100644
--- a/typo3/sysext/scheduler/Tests/Functional/Tca/TaskGroupVisibleFieldsTest.php
+++ b/typo3/sysext/scheduler/Tests/Functional/Tca/TaskGroupVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Scheduler\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -42,7 +42,7 @@ class TaskGroupVisibleFieldsTest extends FunctionalTestCase
     public function taskGroupFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('tx_scheduler_task_group');
diff --git a/typo3/sysext/setup/Classes/Controller/SetupModuleController.php b/typo3/sysext/setup/Classes/Controller/SetupModuleController.php
index dcfe5a3041db..07a5af6ccad7 100644
--- a/typo3/sysext/setup/Classes/Controller/SetupModuleController.php
+++ b/typo3/sysext/setup/Classes/Controller/SetupModuleController.php
@@ -36,6 +36,7 @@ use TYPO3\CMS\Core\Http\HtmlResponse;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessageService;
 use TYPO3\CMS\Core\Page\PageRenderer;
@@ -152,19 +153,22 @@ class SetupModuleController
     protected IconFactory $iconFactory;
     protected PageRenderer $pageRenderer;
     protected ModuleTemplateFactory $moduleTemplateFactory;
+    protected LanguageServiceFactory $languageServiceFactory;
 
     public function __construct(
         EventDispatcherInterface $eventDispatcher,
         MfaProviderRegistry $mfaProviderRegistry,
         IconFactory $iconFactory,
         PageRenderer $pageRenderer,
-        ModuleTemplateFactory $moduleTemplateFactory
+        ModuleTemplateFactory $moduleTemplateFactory,
+        LanguageServiceFactory $languageServiceFactory
     ) {
         $this->eventDispatcher = $eventDispatcher;
         $this->mfaProviderRegistry = $mfaProviderRegistry;
         $this->iconFactory = $iconFactory;
         $this->pageRenderer = $pageRenderer;
         $this->moduleTemplateFactory = $moduleTemplateFactory;
+        $this->languageServiceFactory = $languageServiceFactory;
         // Instantiate the form protection before a simulated user is initialized
         $this->formProtection = FormProtectionFactory::get();
     }
@@ -702,7 +706,7 @@ class SetupModuleController
         $languageService = $this->getLanguageService();
         $content = '';
         // get all labels in default language as well
-        $defaultLanguageLabelService = LanguageService::create('default');
+        $defaultLanguageLabelService = $this->languageServiceFactory->create('default');
         $defaultLanguageLabelService->includeLLFile('EXT:setup/Resources/Private/Language/locallang.xlf');
         foreach ($items as $item) {
             $languageCode = $item[1];
@@ -1011,10 +1015,7 @@ class SetupModuleController
         return $GLOBALS['BE_USER'];
     }
 
-    /**
-     * @return LanguageService
-     */
-    protected function getLanguageService()
+    protected function getLanguageService(): LanguageService
     {
         return $GLOBALS['LANG'];
     }
diff --git a/typo3/sysext/sys_note/Tests/Functional/Tca/NoteVisibleFieldsTest.php b/typo3/sysext/sys_note/Tests/Functional/Tca/NoteVisibleFieldsTest.php
index 58affda4b389..720b030d64ed 100644
--- a/typo3/sysext/sys_note/Tests/Functional/Tca/NoteVisibleFieldsTest.php
+++ b/typo3/sysext/sys_note/Tests/Functional/Tca/NoteVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\SysNote\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -43,7 +43,7 @@ class NoteVisibleFieldsTest extends FunctionalTestCase
     public function noteFormContainsExpectedFields()
     {
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
         $formResult = $formEngineTestService->createNewRecordForm('sys_note');
diff --git a/typo3/sysext/workspaces/Classes/Middleware/WorkspacePreview.php b/typo3/sysext/workspaces/Classes/Middleware/WorkspacePreview.php
index 2c62db5f64ad..02953faeebe1 100644
--- a/typo3/sysext/workspaces/Classes/Middleware/WorkspacePreview.php
+++ b/typo3/sysext/workspaces/Classes/Middleware/WorkspacePreview.php
@@ -34,6 +34,7 @@ use TYPO3\CMS\Core\Http\HtmlResponse;
 use TYPO3\CMS\Core\Http\NormalizedParams;
 use TYPO3\CMS\Core\Http\Stream;
 use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Routing\RouteResultInterface;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
@@ -413,7 +414,7 @@ class WorkspacePreview implements MiddlewareInterface
      */
     protected function getLanguageService(): LanguageService
     {
-        return $GLOBALS['LANG'] ?: LanguageService::create('default');
+        return $GLOBALS['LANG'] ?: GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
     }
 
     /**
diff --git a/typo3/sysext/workspaces/Tests/Functional/Tca/WorkspaceStageVisibleFieldsTest.php b/typo3/sysext/workspaces/Tests/Functional/Tca/WorkspaceStageVisibleFieldsTest.php
index 51306ed380e6..58ce63972279 100644
--- a/typo3/sysext/workspaces/Tests/Functional/Tca/WorkspaceStageVisibleFieldsTest.php
+++ b/typo3/sysext/workspaces/Tests/Functional/Tca/WorkspaceStageVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Workspaces\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -47,7 +47,7 @@ class WorkspaceStageVisibleFieldsTest extends FunctionalTestCase
         parent::setUp();
 
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
     }
 
     /**
diff --git a/typo3/sysext/workspaces/Tests/Functional/Tca/WorkspaceVisibleFieldsTest.php b/typo3/sysext/workspaces/Tests/Functional/Tca/WorkspaceVisibleFieldsTest.php
index 3fe8dba2c3aa..9e8439854664 100644
--- a/typo3/sysext/workspaces/Tests/Functional/Tca/WorkspaceVisibleFieldsTest.php
+++ b/typo3/sysext/workspaces/Tests/Functional/Tca/WorkspaceVisibleFieldsTest.php
@@ -16,7 +16,7 @@
 namespace TYPO3\CMS\Workspaces\Tests\Functional\Tca;
 
 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
-use TYPO3\CMS\Core\Localization\LanguageService;
+use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
@@ -62,7 +62,7 @@ class WorkspaceVisibleFieldsTest extends FunctionalTestCase
         parent::setUp();
 
         $this->setUpBackendUserFromFixture(1);
-        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
+        $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
 
         $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/workspaces/Tests/Functional/Fixtures/sys_filemounts.xml');
     }
-- 
GitLab