private function getViewLocale(Request $request)
    {
        $viewLocale = $request->query->get('lang', null);
        if (null === $viewLocale) {
            // fallback for old parameter
            $viewLocale = $request->query->get('locale', null);
        }

        return $viewLocale;
    }
private function getViewLocale(Request $request)
    {
        $viewLocale = $request->query->get('lang', null);
        if (null === $viewLocale) {
            // fallback for old parameter
            $viewLocale = $request->query->get('locale', null);
        }

        return $viewLocale;
    }
private function getViewLocale ( Request $ request ) { $ viewLocale = $ request -> query -> get ( 'lang' , null ) ; if ( null === $ viewLocale ) { // fallback for old parameter $ viewLocale = $ request -> query -> get ( 'locale' , null ) ; } return $ viewLocale ; }
Get the locale code from the lang attribute in URL.

@param Request $request
@return null|string
Get the locale code from the lang attribute in URL .