private function getLanguage()
    {
        $wpLang = (function_exists('get_locale')) ? get_locale() : null;
        $browserLang = null;
        if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
            $browserLang = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
        }

        return  substr($wpLang ?: $browserLang ?: 'en', 0, 2);
    }
private function getLanguage()
    {
        $wpLang = (function_exists('get_locale')) ? get_locale() : null;
        $browserLang = null;
        if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
            $browserLang = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
        }

        return  substr($wpLang ?: $browserLang ?: 'en', 0, 2);
    }
private function getLanguage ( ) { $ wpLang = ( function_exists ( 'get_locale' ) ) ? get_locale ( ) : null ; $ browserLang = null ; if ( isset ( $ _SERVER [ 'HTTP_ACCEPT_LANGUAGE' ] ) ) { $ browserLang = $ _SERVER [ 'HTTP_ACCEPT_LANGUAGE' ] ; } return substr ( $ wpLang ? : $ browserLang ? : 'en' , 0 , 2 ) ; }
Gets the current locale.

@uses \get_locale() → gets the current locale in WordPress
Gets the current locale .