library/Garp/Application/Resource/Router.php
protected function _getCurrentLanguage() {
        if (!isset($_SERVER['REQUEST_URI'])) {
            // Probably CLI context. Return the default locale
            return Garp_I18n::getDefaultLocale();
        }
        $requestUri = $_SERVER['REQUEST_URI'];
        $bits = explode('/', $requestUri);
        // remove empty values
        $bits = array_filter($bits, 'strlen');
        // reindex the array
        $bits = array_values($bits);
        $bits = array_map('strtolower', $bits);
        $locales = $this->_getPossibleLocales();
        if (array_key_exists(0, $bits) && in_array($bits[0], $locales)) {
            return $bits[0];
        }
        return Garp_I18n::getDefaultLocale();
    }
protected function _getCurrentLanguage() {
        if (!isset($_SERVER['REQUEST_URI'])) {
            // Probably CLI context. Return the default locale
            return Garp_I18n::getDefaultLocale();
        }
        $requestUri = $_SERVER['REQUEST_URI'];
        $bits = explode('/', $requestUri);
        // remove empty values
        $bits = array_filter($bits, 'strlen');
        // reindex the array
        $bits = array_values($bits);
        $bits = array_map('strtolower', $bits);
        $locales = $this->_getPossibleLocales();
        if (array_key_exists(0, $bits) && in_array($bits[0], $locales)) {
            return $bits[0];
        }
        return Garp_I18n::getDefaultLocale();
    }
protected function _getCurrentLanguage ( ) { if ( ! isset ( $ _SERVER [ 'REQUEST_URI' ] ) ) { // Probably CLI context. Return the default locale return Garp_I18n :: getDefaultLocale ( ) ; } $ requestUri = $ _SERVER [ 'REQUEST_URI' ] ; $ bits = explode ( '/' , $ requestUri ) ; // remove empty values $ bits = array_filter ( $ bits , 'strlen' ) ; // reindex the array $ bits = array_values ( $ bits ) ; $ bits = array_map ( 'strtolower' , $ bits ) ; $ locales = $ this -> _getPossibleLocales ( ) ; if ( array_key_exists ( 0 , $ bits ) && in_array ( $ bits [ 0 ] , $ locales ) ) { return $ bits [ 0 ] ; } return Garp_I18n :: getDefaultLocale ( ) ; }
Get current language from URL

@return string
Get current language from URL