private static function getCompatibleLocale(string $locale): string
    {
        if (!class_exists('Locale', true)) {
            return $locale;
        }
        
        return \Locale::acceptFromHttp($locale);
    }
private static function getCompatibleLocale(string $locale): string
    {
        if (!class_exists('Locale', true)) {
            return $locale;
        }
        
        return \Locale::acceptFromHttp($locale);
    }
private static function getCompatibleLocale ( string $ locale ) : string { if ( ! class_exists ( 'Locale' , true ) ) { return $ locale ; } return \ Locale :: acceptFromHttp ( $ locale ) ; }
Tries to find out best available locale for the given value but with additional checking if intl module is available.

@param string $locale
The string containing the wanted locale according to format in RFC 2616.

@return string The corresponding locale identifier.

@see \Locale::acceptFromHttp
Tries to find out best available locale for the given value but with additional checking if intl module is available .