src/UriLocalizer.php
public function localeFromRequest($segment = 0)
    {
        $url = $this->request->getUri();
        return $this->getLocaleFromUrl($url, $segment);
    }
public function localeFromRequest($segment = 0)
    {
        $url = $this->request->getUri();
        return $this->getLocaleFromUrl($url, $segment);
    }
public function localeFromRequest ( $ segment = 0 ) { $ url = $ this -> request -> getUri ( ) ; return $ this -> getLocaleFromUrl ( $ url , $ segment ) ; }
Returns the locale present in the current url, if any.

@param  integer $segment     Index of the segment containing locale info
@return string
Returns the locale present in the current url if any .