Checks if the localization server can be contacted.
string $uri: The URI to contact.
string TRUE if the URI was contacted successfully, FALSE if not.
function install_check_localization_server($uri) {
try {
$request = Drupal::httpClient()
->head($uri);
$request
->send();
return TRUE;
} catch (RequestException $e) {
return FALSE;
}
}