public function getUriLocale($uri)
    {
        $parts = explode('/', $uri);
        $locale = $parts[1];

        if (count($parts) < 2 || ! in_array($locale, $this->getLocales())) {
            return;
        }

        return $locale;
    }
public function getUriLocale($uri)
    {
        $parts = explode('/', $uri);
        $locale = $parts[1];

        if (count($parts) < 2 || ! in_array($locale, $this->getLocales())) {
            return;
        }

        return $locale;
    }
public function getUriLocale ( $ uri ) { $ parts = explode ( '/' , $ uri ) ; $ locale = $ parts [ 1 ] ; if ( count ( $ parts ) < 2 || ! in_array ( $ locale , $ this -> getLocales ( ) ) ) { return ; } return $ locale ; }
Get the locale from this URI

@param  string  $uri
@return string|null
Get the locale from this URI