public static function getLocale(bool $reload = false)
    {
        if (!empty(self::$runtimeLocale) && !$reload) {
            return self::$runtimeLocale;
        }
        
        $defaultLocale = Config::getConfigurationValueOrDefault('defaultLocale', Language::ENGLISH_US);
        
        if (Request::hasCookie(Language::LANGUAGE_COOKIE_NAME)) {
            return Request::getCookie(Language::LANGUAGE_COOKIE_NAME);
        }
        
        $acceptLocale = ArrayUtils::getArrayValueForKeyOrDefault($_SERVER, 'HTTP_ACCEPT_LANGUAGE', $defaultLocale);
        self::$runtimeLocale = self::getCompatibleLocale($acceptLocale);
        
        return self::$runtimeLocale;
    }
public static function getLocale(bool $reload = false)
    {
        if (!empty(self::$runtimeLocale) && !$reload) {
            return self::$runtimeLocale;
        }
        
        $defaultLocale = Config::getConfigurationValueOrDefault('defaultLocale', Language::ENGLISH_US);
        
        if (Request::hasCookie(Language::LANGUAGE_COOKIE_NAME)) {
            return Request::getCookie(Language::LANGUAGE_COOKIE_NAME);
        }
        
        $acceptLocale = ArrayUtils::getArrayValueForKeyOrDefault($_SERVER, 'HTTP_ACCEPT_LANGUAGE', $defaultLocale);
        self::$runtimeLocale = self::getCompatibleLocale($acceptLocale);
        
        return self::$runtimeLocale;
    }
public static function getLocale ( bool $ reload = false ) { if ( ! empty ( self :: $ runtimeLocale ) && ! $ reload ) { return self :: $ runtimeLocale ; } $ defaultLocale = Config :: getConfigurationValueOrDefault ( 'defaultLocale' , Language :: ENGLISH_US ) ; if ( Request :: hasCookie ( Language :: LANGUAGE_COOKIE_NAME ) ) { return Request :: getCookie ( Language :: LANGUAGE_COOKIE_NAME ) ; } $ acceptLocale = ArrayUtils :: getArrayValueForKeyOrDefault ( $ _SERVER , 'HTTP_ACCEPT_LANGUAGE' , $ defaultLocale ) ; self :: $ runtimeLocale = self :: getCompatibleLocale ( $ acceptLocale ) ; return self :: $ runtimeLocale ; }
Get the locale for the current client.
The default is currently set to English.

@param bool $reload
The locale is cached for the current run.
When reload is set to true, it is guaranteed to return the latest configured.

@return string Locale based on a combination of ISO-639 language code and ISO-3166 country code.
Get the locale for the current client . The default is currently set to English .