/** * Set the right locale via context. * * @param GetResponseEvent $event */ public function onKernelRequest(GetResponseEvent $event) { $request = $event->getRequest(); if (!$request->hasPreviousSession()) { return; } $request->setLocale($this->localeContext->getLocale() ?: $this->localeContext->getDefaultLocale()); }
/** * {@inheritdoc} */ protected function getDefaultLocale() { return $this->localeContext->getLocale(); }
/** * {@inheritdoc} */ public function getCurrentLocale() { return $this->localeContext->getLocale(); }