X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/6be82a837fde1a6098a34304b129292a2bc6b738..86058711723e68e3a174d69317593d54096b28a0:/EventSubscriber/LocaleSubscriber.php?ds=inline diff --git a/EventSubscriber/LocaleSubscriber.php b/EventSubscriber/LocaleSubscriber.php index 29417a7..5975bd3 100644 --- a/EventSubscriber/LocaleSubscriber.php +++ b/EventSubscriber/LocaleSubscriber.php @@ -34,34 +34,22 @@ class LocaleSubscriber implements EventSubscriberInterface { $request->getSession()->set('_locale', $preferred); //Send vary header as current page locale depend on it - header('Vary: accept-language'); + #header('Vary: accept-language'); //Set locale - $request->setLocale($preferred); + #$request->setLocale($preferred); //Set default locale - $request->setDefaultLocale($preferred); + #$request->setDefaultLocale($preferred); //Get router context - $context = $this->router->getContext(); + #$context = $this->router->getContext(); //Set context locale - $context->setParameter('_locale', $preferred); + #$context->setParameter('_locale', $preferred); //Set back router context - $this->router->setContext($context); - - //Generate current route with preferred language - //XXX: may trigger a Symfony\Component\Routing\Exception\RouteNotFoundException if route is not found for preferred locale - /*$uri = $this->router->generate( - //Current route - $request->get('_route'), - //Force preferred locale - ['_locale' => $preferred]+$request->get('_route_params') - ); - - //Regenerate route with preferred locale - $event->setResponse(new RedirectResponse($uri, 302));*/ + #$this->router->setContext($context); //End process return;