Skip to content
Snippets Groups Projects
Verified Commit 6c1360bc authored by Dave Long's avatar Dave Long
Browse files

Issue #3478408 by jaydev bhatt, quietone, goonerw: Fix errors in update-countries.sh

(cherry picked from commit 61dfd43e)
parent b0ef5921
Branches
Tags
2 merge requests!12227Issue #3181946 by jonmcl, mglaman,!12079Issue #3523476 by matthiasm11: Add empty check on operator
Pipeline #487772 failed
...@@ -35,6 +35,16 @@ ...@@ -35,6 +35,16 @@
exit('CLDR data file not found. (' . $uri . ")\n\n" . $usage . "\n"); 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. // Read in existing codes.
// @todo Allow to remove previously existing country codes. // @todo Allow to remove previously existing country codes.
// @see https://www.drupal.org/node/1436754 // @see https://www.drupal.org/node/1436754
...@@ -93,7 +103,7 @@ ...@@ -93,7 +103,7 @@
foreach ($countries as $code => $name) { foreach ($countries as $code => $name) {
// For .po translation file's sake, use double-quotes instead of escaped // For .po translation file's sake, use double-quotes instead of escaped
// single-quotes. // single-quotes.
$name = str_contains($name, '\'' ? '"' . $name . '"' : "'" . $name . "'"); $name = str_contains($name, '\'') ? '"' . $name . '"' : "'" . $name . "'";
$out .= ' ' . var_export($code, TRUE) . ' => t(' . $name . '),' . "\n"; $out .= ' ' . var_export($code, TRUE) . ' => t(' . $name . '),' . "\n";
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment