src/Routelocale.php
public function getLocaleFromRoute($segments = null) {
        // if segmets are not set - get from current request
        if (is_null($segments)) {
            $segments = \Request::segments();
        }
        $locale = $this->getDefaultRoutelocale();
        if ($allLocales = \Routelocale::getAllRoutelocales()) {
            // reduce array of segments to [0] and find by value
            if ($curLocaleIndex = array_search(array_shift($segments), $allLocales)) {
                $locale = $allLocales[$curLocaleIndex];
            }  
        }
        return $locale;
    }
public function getLocaleFromRoute($segments = null) {
        // if segmets are not set - get from current request
        if (is_null($segments)) {
            $segments = \Request::segments();
        }
        $locale = $this->getDefaultRoutelocale();
        if ($allLocales = \Routelocale::getAllRoutelocales()) {
            // reduce array of segments to [0] and find by value
            if ($curLocaleIndex = array_search(array_shift($segments), $allLocales)) {
                $locale = $allLocales[$curLocaleIndex];
            }  
        }
        return $locale;
    }
public function getLocaleFromRoute ( $ segments = null ) { // if segmets are not set - get from current request
 if ( is_null ( $ segments ) ) { $ segments = \ Request :: segments ( ) ; } $ locale = $ this -> getDefaultRoutelocale ( ) ; if ( $ allLocales = \ Routelocale :: getAllRoutelocales ( ) ) { // reduce array of segments to [0] and find by value
 if ( $ curLocaleIndex = array_search ( array_shift ( $ segments ) , $ allLocales ) ) { $ locale = $ allLocales [ $ curLocaleIndex ] ; } } return $ locale ; }
Returns the route locale. Fallback to default locale.
@param  array|null $segments. The route segments. If null - segments will be pulled from current request
@return string Locale
Returns the route locale . Fallback to default locale .