diff options
Diffstat (limited to 'core/scripts')
-rwxr-xr-x | core/scripts/run-tests.sh | 2 | ||||
-rwxr-xr-x | core/scripts/update-countries.sh | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index 30e366f97b2e..a1a9d903af03 100755 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -667,7 +667,7 @@ function simpletest_script_setup_database($new = FALSE): void { // Remove a possibly existing default connection (from settings.php). Database::removeConnection('default'); try { - $databases['default']['default'] = Database::convertDbUrlToConnectionInfo($args['dburl'], DRUPAL_ROOT, TRUE); + $databases['default']['default'] = Database::convertDbUrlToConnectionInfo($args['dburl'], TRUE); } catch (\InvalidArgumentException $e) { simpletest_script_print_error('Invalid --dburl. Reason: ' . $e->getMessage()); diff --git a/core/scripts/update-countries.sh b/core/scripts/update-countries.sh index 52676e9f30bb..59f04b196ee6 100755 --- a/core/scripts/update-countries.sh +++ b/core/scripts/update-countries.sh @@ -35,6 +35,16 @@ USAGE; exit('CLDR data file not found. (' . $uri . ")\n\n" . $usage . "\n"); } +// Fake the t() function used in CountryManager.php instead of attempting a full +// Drupal bootstrap of core/includes/bootstrap.inc (where t() is declared). +if (!function_exists('t')) { + + function t($string): string { + return $string; + } + +} + // Read in existing codes. // @todo Allow to remove previously existing country codes. // @see https://www.drupal.org/node/1436754 @@ -93,7 +103,7 @@ $out = ''; foreach ($countries as $code => $name) { // For .po translation file's sake, use double-quotes instead of escaped // single-quotes. - $name = str_contains($name, '\'' ? '"' . $name . '"' : "'" . $name . "'"); + $name = str_contains($name, '\'') ? '"' . $name . '"' : "'" . $name . "'"; $out .= ' ' . var_export($code, TRUE) . ' => t(' . $name . '),' . "\n"; } |