You are here

public function TranslatorListener::onKernelFinishRequest in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/EventListener/TranslatorListener.php \Symfony\Component\HttpKernel\EventListener\TranslatorListener::onKernelFinishRequest()

File

vendor/symfony/http-kernel/EventListener/TranslatorListener.php, line 43

Class

TranslatorListener
Synchronizes the locale between the request and the translator.

Namespace

Symfony\Component\HttpKernel\EventListener

Code

public function onKernelFinishRequest(FinishRequestEvent $event) {
  if (null === ($parentRequest = $this->requestStack
    ->getParentRequest())) {
    return;
  }
  $this
    ->setLocale($parentRequest);
}