protected function determineLocale(GetResponseEvent $event)
    {
        $locale = $event->getRequest()->getLocale();

        return in_array($locale, $this->allowedLocales) ?
            $locale :
            null;
    }
protected function determineLocale(GetResponseEvent $event)
    {
        $locale = $event->getRequest()->getLocale();

        return in_array($locale, $this->allowedLocales) ?
            $locale :
            null;
    }
protected function determineLocale ( GetResponseEvent $ event ) { $ locale = $ event -> getRequest ( ) -> getLocale ( ) ; return in_array ( $ locale , $ this -> allowedLocales ) ? $ locale : null ; }
Decides which locale will be used.

@param GetResponseEvent $event used to get the request

@return mixed string|null a locale or null if no valid locale is found
Decides which locale will be used .