You are here

public function LanguageRequestSubscriber::onKernelRequestLanguage in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/language/src/EventSubscriber/LanguageRequestSubscriber.php \Drupal\language\EventSubscriber\LanguageRequestSubscriber::onKernelRequestLanguage()
  2. 9 core/modules/language/src/EventSubscriber/LanguageRequestSubscriber.php \Drupal\language\EventSubscriber\LanguageRequestSubscriber::onKernelRequestLanguage()

Initializes the language manager at the beginning of the request.

Parameters

\Symfony\Component\HttpKernel\Event\RequestEvent $event: The Event to process.

File

core/modules/language/src/EventSubscriber/LanguageRequestSubscriber.php, line 72

Class

LanguageRequestSubscriber
Sets the $request property on the language manager.

Namespace

Drupal\language\EventSubscriber

Code

public function onKernelRequestLanguage(RequestEvent $event) {
  if ($event
    ->isMainRequest()) {
    $this
      ->setLanguageOverrides();
  }
}