protected function findLocale()
    {
        $locale = null;

        if (PHP_SAPI == 'cli') {
            $locale = getenv('LANG');
        } else if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && extension_loaded('intl')) {
            $locale = \Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);
        }

        return $locale;
    }
protected function findLocale()
    {
        $locale = null;

        if (PHP_SAPI == 'cli') {
            $locale = getenv('LANG');
        } else if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && extension_loaded('intl')) {
            $locale = \Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);
        }

        return $locale;
    }
protected function findLocale ( ) { $ locale = null ; if ( PHP_SAPI == 'cli' ) { $ locale = getenv ( 'LANG' ) ; } else if ( isset ( $ _SERVER [ 'HTTP_ACCEPT_LANGUAGE' ] ) && extension_loaded ( 'intl' ) ) { $ locale = \ Locale :: acceptFromHttp ( $ _SERVER [ 'HTTP_ACCEPT_LANGUAGE' ] ) ; } return $ locale ; }
Find the current locale

@return string
Find the current locale