From 5971ebdfe77828c8ca220ffb7003f1261a1b1575 Mon Sep 17 00:00:00 2001
From: Dave Long <dave@longwaveconsulting.com>
Date: Mon, 27 Feb 2023 13:25:57 +0000
Subject: [PATCH] =?UTF-8?q?Revert=20"Issue=20#3262017=20by=20sleitner,=20r?=
 =?UTF-8?q?avi.shankar,=20smustgrave,=20xjm,=20longwave,=20quietone,=20G?=
 =?UTF-8?q?=C3=A1bor=20Hojtsy,=20catch,=20alexpott:=20Country=20list=20is?=
 =?UTF-8?q?=20not=20correctly=20sorted=20when=20it's=20localized=20with=20?=
 =?UTF-8?q?accents=20(e.g.=20German,=20Turkish)"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This reverts commit c34b922a530e192829f7b0cf61146226b9ce0ecb.
---
 core/core.services.yml                        |   2 +-
 .../lib/Drupal/Core/Locale/CountryManager.php | 587 ++++++++----------
 core/scripts/update-countries.sh              |   4 +-
 .../Core/Locale/CountryManagerTest.php        |  90 ---
 4 files changed, 269 insertions(+), 414 deletions(-)
 delete mode 100644 core/tests/Drupal/FunctionalTests/Core/Locale/CountryManagerTest.php

diff --git a/core/core.services.yml b/core/core.services.yml
index 3b5b650ba390..1c5d787c5727 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -1552,7 +1552,7 @@ services:
   Drupal\Core\Batch\BatchStorageInterface: '@batch.storage'
   country_manager:
     class: Drupal\Core\Locale\CountryManager
-    arguments: ['@module_handler', '@transliteration', '@language_manager']
+    arguments: ['@module_handler']
   Drupal\Core\Locale\CountryManagerInterface: '@country_manager'
   date.formatter:
     class: Drupal\Core\Datetime\DateFormatter
diff --git a/core/lib/Drupal/Core/Locale/CountryManager.php b/core/lib/Drupal/Core/Locale/CountryManager.php
index 6416a90cc901..cc80581b0e68 100644
--- a/core/lib/Drupal/Core/Locale/CountryManager.php
+++ b/core/lib/Drupal/Core/Locale/CountryManager.php
@@ -3,9 +3,6 @@
 namespace Drupal\Core\Locale;
 
 use Drupal\Core\Extension\ModuleHandlerInterface;
-use Drupal\Core\Language\LanguageInterface;
-use Drupal\Core\Language\LanguageManagerInterface;
-use Drupal\Component\Transliteration\TransliterationInterface;
 
 /**
  * Provides list of countries.
@@ -20,325 +17,287 @@ class CountryManager implements CountryManagerInterface {
   protected $moduleHandler;
 
   /**
-   * The transliteration service.
-   *
-   * @var \Drupal\Component\Transliteration\TransliterationInterface
-   */
-  protected $transliteration;
-
-  /**
-   * The language manager service.
-   *
-   * @var \Drupal\Core\Language\LanguageManagerInterface
-   */
-  protected $languageManager;
-
-  /**
-   * An array of country code, country name pairs keyed by language code.
-   *
-   * @var array
+   * An array of country code => country name pairs.
    */
-  protected $countries = [];
+  protected $countries;
 
   /**
    * Constructor.
    *
    * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
    *   The module handler.
-   * @param \Drupal\Component\Transliteration\TransliterationInterface|null $transliteration
-   *   The transliteration service.
-   * @param \Drupal\Core\Language\LanguageManagerInterface|null $language_manager
-   *   The language manager service.
    */
-  public function __construct(ModuleHandlerInterface $module_handler, TransliterationInterface $transliteration = NULL, LanguageManagerInterface $language_manager = NULL) {
+  public function __construct(ModuleHandlerInterface $module_handler) {
     $this->moduleHandler = $module_handler;
-    $this->languageManager = $language_manager;
-    $this->transliteration = $transliteration;
-    if (!$transliteration) {
-      @trigger_error('Calling ' . __METHOD__ . ' without the $transliteration argument is deprecated in drupal:10.1.0 and it will be required in drupal:11.0.0. See https://www.drupal.org/node/3280207', E_USER_DEPRECATED);
-      $this->transliteration = \Drupal::service('transliteration');
-    }
-    if (!$language_manager) {
-      @trigger_error('Calling ' . __METHOD__ . ' without the $language_manager argument is deprecated in drupal:10.1.0 and it will be required in drupal:11.0.0. See https://www.drupal.org/node/3280207', E_USER_DEPRECATED);
-      $this->languageManager = \Drupal::service('language_manager');
-    }
   }
 
   /**
    * Get an array of all two-letter country code => country name pairs.
    *
-   * $countries is updated by core/scripts/update-countries.sh.
-   *
-   * @param string|null $language_id
-   *   (optional) The language code for translation.
-   *
    * @return array
    *   An array of country code => country name pairs.
    */
-  public static function getStandardList($language_id = NULL) {
-    // Set up translation options with the specified language.
-    $translation_options = ($language_id === NULL) ? [] : ['langcode' => $language_id];
-
+  public static function getStandardList() {
     // cSpell:disable
     $countries = [
-      'AC' => t('Ascension Island', [], $translation_options),
-      'AD' => t('Andorra', [], $translation_options),
-      'AE' => t('United Arab Emirates', [], $translation_options),
-      'AF' => t('Afghanistan', [], $translation_options),
-      'AG' => t('Antigua & Barbuda', [], $translation_options),
-      'AI' => t('Anguilla', [], $translation_options),
-      'AL' => t('Albania', [], $translation_options),
-      'AM' => t('Armenia', [], $translation_options),
-      'AN' => t('Netherlands Antilles', [], $translation_options),
-      'AO' => t('Angola', [], $translation_options),
-      'AQ' => t('Antarctica', [], $translation_options),
-      'AR' => t('Argentina', [], $translation_options),
-      'AS' => t('American Samoa', [], $translation_options),
-      'AT' => t('Austria', [], $translation_options),
-      'AU' => t('Australia', [], $translation_options),
-      'AW' => t('Aruba', [], $translation_options),
-      'AX' => t('Ã…land Islands', [], $translation_options),
-      'AZ' => t('Azerbaijan', [], $translation_options),
-      'BA' => t('Bosnia & Herzegovina', [], $translation_options),
-      'BB' => t('Barbados', [], $translation_options),
-      'BD' => t('Bangladesh', [], $translation_options),
-      'BE' => t('Belgium', [], $translation_options),
-      'BF' => t('Burkina Faso', [], $translation_options),
-      'BG' => t('Bulgaria', [], $translation_options),
-      'BH' => t('Bahrain', [], $translation_options),
-      'BI' => t('Burundi', [], $translation_options),
-      'BJ' => t('Benin', [], $translation_options),
-      'BL' => t('St. Barthélemy', [], $translation_options),
-      'BM' => t('Bermuda', [], $translation_options),
-      'BN' => t('Brunei', [], $translation_options),
-      'BO' => t('Bolivia', [], $translation_options),
-      'BQ' => t('Caribbean Netherlands', [], $translation_options),
-      'BR' => t('Brazil', [], $translation_options),
-      'BS' => t('Bahamas', [], $translation_options),
-      'BT' => t('Bhutan', [], $translation_options),
-      'BV' => t('Bouvet Island', [], $translation_options),
-      'BW' => t('Botswana', [], $translation_options),
-      'BY' => t('Belarus', [], $translation_options),
-      'BZ' => t('Belize', [], $translation_options),
-      'CA' => t('Canada', [], $translation_options),
-      'CC' => t('Cocos (Keeling) Islands', [], $translation_options),
-      'CD' => t('Congo - Kinshasa', [], $translation_options),
-      'CF' => t('Central African Republic', [], $translation_options),
-      'CG' => t('Congo - Brazzaville', [], $translation_options),
-      'CH' => t('Switzerland', [], $translation_options),
-      'CI' => t('Côte d’Ivoire', [], $translation_options),
-      'CK' => t('Cook Islands', [], $translation_options),
-      'CL' => t('Chile', [], $translation_options),
-      'CM' => t('Cameroon', [], $translation_options),
-      'CN' => t('China', [], $translation_options),
-      'CO' => t('Colombia', [], $translation_options),
-      'CP' => t('Clipperton Island', [], $translation_options),
-      'CR' => t('Costa Rica', [], $translation_options),
-      'CU' => t('Cuba', [], $translation_options),
-      'CV' => t('Cape Verde', [], $translation_options),
-      'CW' => t('Curaçao', [], $translation_options),
-      'CX' => t('Christmas Island', [], $translation_options),
-      'CY' => t('Cyprus', [], $translation_options),
-      'CZ' => t('Czechia', [], $translation_options),
-      'DE' => t('Germany', [], $translation_options),
-      'DG' => t('Diego Garcia', [], $translation_options),
-      'DJ' => t('Djibouti', [], $translation_options),
-      'DK' => t('Denmark', [], $translation_options),
-      'DM' => t('Dominica', [], $translation_options),
-      'DO' => t('Dominican Republic', [], $translation_options),
-      'DZ' => t('Algeria', [], $translation_options),
-      'EA' => t('Ceuta & Melilla', [], $translation_options),
-      'EC' => t('Ecuador', [], $translation_options),
-      'EE' => t('Estonia', [], $translation_options),
-      'EG' => t('Egypt', [], $translation_options),
-      'EH' => t('Western Sahara', [], $translation_options),
-      'ER' => t('Eritrea', [], $translation_options),
-      'ES' => t('Spain', [], $translation_options),
-      'ET' => t('Ethiopia', [], $translation_options),
-      'FI' => t('Finland', [], $translation_options),
-      'FJ' => t('Fiji', [], $translation_options),
-      'FK' => t('Falkland Islands', [], $translation_options),
-      'FM' => t('Micronesia', [], $translation_options),
-      'FO' => t('Faroe Islands', [], $translation_options),
-      'FR' => t('France', [], $translation_options),
-      'GA' => t('Gabon', [], $translation_options),
-      'GB' => t('United Kingdom', [], $translation_options),
-      'GD' => t('Grenada', [], $translation_options),
-      'GE' => t('Georgia', [], $translation_options),
-      'GF' => t('French Guiana', [], $translation_options),
-      'GG' => t('Guernsey', [], $translation_options),
-      'GH' => t('Ghana', [], $translation_options),
-      'GI' => t('Gibraltar', [], $translation_options),
-      'GL' => t('Greenland', [], $translation_options),
-      'GM' => t('Gambia', [], $translation_options),
-      'GN' => t('Guinea', [], $translation_options),
-      'GP' => t('Guadeloupe', [], $translation_options),
-      'GQ' => t('Equatorial Guinea', [], $translation_options),
-      'GR' => t('Greece', [], $translation_options),
-      'GS' => t('South Georgia & South Sandwich Islands', [], $translation_options),
-      'GT' => t('Guatemala', [], $translation_options),
-      'GU' => t('Guam', [], $translation_options),
-      'GW' => t('Guinea-Bissau', [], $translation_options),
-      'GY' => t('Guyana', [], $translation_options),
-      'HK' => t('Hong Kong SAR China', [], $translation_options),
-      'HM' => t('Heard & McDonald Islands', [], $translation_options),
-      'HN' => t('Honduras', [], $translation_options),
-      'HR' => t('Croatia', [], $translation_options),
-      'HT' => t('Haiti', [], $translation_options),
-      'HU' => t('Hungary', [], $translation_options),
-      'IC' => t('Canary Islands', [], $translation_options),
-      'ID' => t('Indonesia', [], $translation_options),
-      'IE' => t('Ireland', [], $translation_options),
-      'IL' => t('Israel', [], $translation_options),
-      'IM' => t('Isle of Man', [], $translation_options),
-      'IN' => t('India', [], $translation_options),
-      'IO' => t('British Indian Ocean Territory', [], $translation_options),
-      'IQ' => t('Iraq', [], $translation_options),
-      'IR' => t('Iran', [], $translation_options),
-      'IS' => t('Iceland', [], $translation_options),
-      'IT' => t('Italy', [], $translation_options),
-      'JE' => t('Jersey', [], $translation_options),
-      'JM' => t('Jamaica', [], $translation_options),
-      'JO' => t('Jordan', [], $translation_options),
-      'JP' => t('Japan', [], $translation_options),
-      'KE' => t('Kenya', [], $translation_options),
-      'KG' => t('Kyrgyzstan', [], $translation_options),
-      'KH' => t('Cambodia', [], $translation_options),
-      'KI' => t('Kiribati', [], $translation_options),
-      'KM' => t('Comoros', [], $translation_options),
-      'KN' => t('St. Kitts & Nevis', [], $translation_options),
-      'KP' => t('North Korea', [], $translation_options),
-      'KR' => t('South Korea', [], $translation_options),
-      'KW' => t('Kuwait', [], $translation_options),
-      'KY' => t('Cayman Islands', [], $translation_options),
-      'KZ' => t('Kazakhstan', [], $translation_options),
-      'LA' => t('Laos', [], $translation_options),
-      'LB' => t('Lebanon', [], $translation_options),
-      'LC' => t('St. Lucia', [], $translation_options),
-      'LI' => t('Liechtenstein', [], $translation_options),
-      'LK' => t('Sri Lanka', [], $translation_options),
-      'LR' => t('Liberia', [], $translation_options),
-      'LS' => t('Lesotho', [], $translation_options),
-      'LT' => t('Lithuania', [], $translation_options),
-      'LU' => t('Luxembourg', [], $translation_options),
-      'LV' => t('Latvia', [], $translation_options),
-      'LY' => t('Libya', [], $translation_options),
-      'MA' => t('Morocco', [], $translation_options),
-      'MC' => t('Monaco', [], $translation_options),
-      'MD' => t('Moldova', [], $translation_options),
-      'ME' => t('Montenegro', [], $translation_options),
-      'MF' => t('St. Martin', [], $translation_options),
-      'MG' => t('Madagascar', [], $translation_options),
-      'MH' => t('Marshall Islands', [], $translation_options),
-      'MK' => t('North Macedonia', [], $translation_options),
-      'ML' => t('Mali', [], $translation_options),
-      'MM' => t('Myanmar (Burma)', [], $translation_options),
-      'MN' => t('Mongolia', [], $translation_options),
-      'MO' => t('Macao SAR China', [], $translation_options),
-      'MP' => t('Northern Mariana Islands', [], $translation_options),
-      'MQ' => t('Martinique', [], $translation_options),
-      'MR' => t('Mauritania', [], $translation_options),
-      'MS' => t('Montserrat', [], $translation_options),
-      'MT' => t('Malta', [], $translation_options),
-      'MU' => t('Mauritius', [], $translation_options),
-      'MV' => t('Maldives', [], $translation_options),
-      'MW' => t('Malawi', [], $translation_options),
-      'MX' => t('Mexico', [], $translation_options),
-      'MY' => t('Malaysia', [], $translation_options),
-      'MZ' => t('Mozambique', [], $translation_options),
-      'NA' => t('Namibia', [], $translation_options),
-      'NC' => t('New Caledonia', [], $translation_options),
-      'NE' => t('Niger', [], $translation_options),
-      'NF' => t('Norfolk Island', [], $translation_options),
-      'NG' => t('Nigeria', [], $translation_options),
-      'NI' => t('Nicaragua', [], $translation_options),
-      'NL' => t('Netherlands', [], $translation_options),
-      'NO' => t('Norway', [], $translation_options),
-      'NP' => t('Nepal', [], $translation_options),
-      'NR' => t('Nauru', [], $translation_options),
-      'NU' => t('Niue', [], $translation_options),
-      'NZ' => t('New Zealand', [], $translation_options),
-      'OM' => t('Oman', [], $translation_options),
-      'PA' => t('Panama', [], $translation_options),
-      'PE' => t('Peru', [], $translation_options),
-      'PF' => t('French Polynesia', [], $translation_options),
-      'PG' => t('Papua New Guinea', [], $translation_options),
-      'PH' => t('Philippines', [], $translation_options),
-      'PK' => t('Pakistan', [], $translation_options),
-      'PL' => t('Poland', [], $translation_options),
-      'PM' => t('St. Pierre & Miquelon', [], $translation_options),
-      'PN' => t('Pitcairn Islands', [], $translation_options),
-      'PR' => t('Puerto Rico', [], $translation_options),
-      'PS' => t('Palestinian Territories', [], $translation_options),
-      'PT' => t('Portugal', [], $translation_options),
-      'PW' => t('Palau', [], $translation_options),
-      'PY' => t('Paraguay', [], $translation_options),
-      'QA' => t('Qatar', [], $translation_options),
-      'QO' => t('Outlying Oceania', [], $translation_options),
-      'RE' => t('Réunion', [], $translation_options),
-      'RO' => t('Romania', [], $translation_options),
-      'RS' => t('Serbia', [], $translation_options),
-      'RU' => t('Russia', [], $translation_options),
-      'RW' => t('Rwanda', [], $translation_options),
-      'SA' => t('Saudi Arabia', [], $translation_options),
-      'SB' => t('Solomon Islands', [], $translation_options),
-      'SC' => t('Seychelles', [], $translation_options),
-      'SD' => t('Sudan', [], $translation_options),
-      'SE' => t('Sweden', [], $translation_options),
-      'SG' => t('Singapore', [], $translation_options),
-      'SH' => t('St. Helena', [], $translation_options),
-      'SI' => t('Slovenia', [], $translation_options),
-      'SJ' => t('Svalbard & Jan Mayen', [], $translation_options),
-      'SK' => t('Slovakia', [], $translation_options),
-      'SL' => t('Sierra Leone', [], $translation_options),
-      'SM' => t('San Marino', [], $translation_options),
-      'SN' => t('Senegal', [], $translation_options),
-      'SO' => t('Somalia', [], $translation_options),
-      'SR' => t('Suriname', [], $translation_options),
-      'SS' => t('South Sudan', [], $translation_options),
-      'ST' => t('São Tomé & Príncipe', [], $translation_options),
-      'SV' => t('El Salvador', [], $translation_options),
-      'SX' => t('Sint Maarten', [], $translation_options),
-      'SY' => t('Syria', [], $translation_options),
-      'SZ' => t('Eswatini', [], $translation_options),
-      'TA' => t('Tristan da Cunha', [], $translation_options),
-      'TC' => t('Turks & Caicos Islands', [], $translation_options),
-      'TD' => t('Chad', [], $translation_options),
-      'TF' => t('French Southern Territories', [], $translation_options),
-      'TG' => t('Togo', [], $translation_options),
-      'TH' => t('Thailand', [], $translation_options),
-      'TJ' => t('Tajikistan', [], $translation_options),
-      'TK' => t('Tokelau', [], $translation_options),
-      'TL' => t('Timor-Leste', [], $translation_options),
-      'TM' => t('Turkmenistan', [], $translation_options),
-      'TN' => t('Tunisia', [], $translation_options),
-      'TO' => t('Tonga', [], $translation_options),
-      'TR' => t('Turkey', [], $translation_options),
-      'TT' => t('Trinidad & Tobago', [], $translation_options),
-      'TV' => t('Tuvalu', [], $translation_options),
-      'TW' => t('Taiwan', [], $translation_options),
-      'TZ' => t('Tanzania', [], $translation_options),
-      'UA' => t('Ukraine', [], $translation_options),
-      'UG' => t('Uganda', [], $translation_options),
-      'UM' => t('U.S. Outlying Islands', [], $translation_options),
-      'US' => t('United States', [], $translation_options),
-      'UY' => t('Uruguay', [], $translation_options),
-      'UZ' => t('Uzbekistan', [], $translation_options),
-      'VA' => t('Vatican City', [], $translation_options),
-      'VC' => t('St. Vincent & Grenadines', [], $translation_options),
-      'VE' => t('Venezuela', [], $translation_options),
-      'VG' => t('British Virgin Islands', [], $translation_options),
-      'VI' => t('U.S. Virgin Islands', [], $translation_options),
-      'VN' => t('Vietnam', [], $translation_options),
-      'VU' => t('Vanuatu', [], $translation_options),
-      'WF' => t('Wallis & Futuna', [], $translation_options),
-      'WS' => t('Samoa', [], $translation_options),
-      'XK' => t('Kosovo', [], $translation_options),
-      'YE' => t('Yemen', [], $translation_options),
-      'YT' => t('Mayotte', [], $translation_options),
-      'ZA' => t('South Africa', [], $translation_options),
-      'ZM' => t('Zambia', [], $translation_options),
-      'ZW' => t('Zimbabwe', [], $translation_options),
+      'AC' => t('Ascension Island'),
+      'AD' => t('Andorra'),
+      'AE' => t('United Arab Emirates'),
+      'AF' => t('Afghanistan'),
+      'AG' => t('Antigua & Barbuda'),
+      'AI' => t('Anguilla'),
+      'AL' => t('Albania'),
+      'AM' => t('Armenia'),
+      'AN' => t('Netherlands Antilles'),
+      'AO' => t('Angola'),
+      'AQ' => t('Antarctica'),
+      'AR' => t('Argentina'),
+      'AS' => t('American Samoa'),
+      'AT' => t('Austria'),
+      'AU' => t('Australia'),
+      'AW' => t('Aruba'),
+      'AX' => t('Ã…land Islands'),
+      'AZ' => t('Azerbaijan'),
+      'BA' => t('Bosnia & Herzegovina'),
+      'BB' => t('Barbados'),
+      'BD' => t('Bangladesh'),
+      'BE' => t('Belgium'),
+      'BF' => t('Burkina Faso'),
+      'BG' => t('Bulgaria'),
+      'BH' => t('Bahrain'),
+      'BI' => t('Burundi'),
+      'BJ' => t('Benin'),
+      'BL' => t('St. Barthélemy'),
+      'BM' => t('Bermuda'),
+      'BN' => t('Brunei'),
+      'BO' => t('Bolivia'),
+      'BQ' => t('Caribbean Netherlands'),
+      'BR' => t('Brazil'),
+      'BS' => t('Bahamas'),
+      'BT' => t('Bhutan'),
+      'BV' => t('Bouvet Island'),
+      'BW' => t('Botswana'),
+      'BY' => t('Belarus'),
+      'BZ' => t('Belize'),
+      'CA' => t('Canada'),
+      'CC' => t('Cocos (Keeling) Islands'),
+      'CD' => t('Congo - Kinshasa'),
+      'CF' => t('Central African Republic'),
+      'CG' => t('Congo - Brazzaville'),
+      'CH' => t('Switzerland'),
+      'CI' => t('Côte d’Ivoire'),
+      'CK' => t('Cook Islands'),
+      'CL' => t('Chile'),
+      'CM' => t('Cameroon'),
+      'CN' => t('China'),
+      'CO' => t('Colombia'),
+      'CP' => t('Clipperton Island'),
+      'CR' => t('Costa Rica'),
+      'CU' => t('Cuba'),
+      'CV' => t('Cape Verde'),
+      'CW' => t('Curaçao'),
+      'CX' => t('Christmas Island'),
+      'CY' => t('Cyprus'),
+      'CZ' => t('Czechia'),
+      'DE' => t('Germany'),
+      'DG' => t('Diego Garcia'),
+      'DJ' => t('Djibouti'),
+      'DK' => t('Denmark'),
+      'DM' => t('Dominica'),
+      'DO' => t('Dominican Republic'),
+      'DZ' => t('Algeria'),
+      'EA' => t('Ceuta & Melilla'),
+      'EC' => t('Ecuador'),
+      'EE' => t('Estonia'),
+      'EG' => t('Egypt'),
+      'EH' => t('Western Sahara'),
+      'ER' => t('Eritrea'),
+      'ES' => t('Spain'),
+      'ET' => t('Ethiopia'),
+      'FI' => t('Finland'),
+      'FJ' => t('Fiji'),
+      'FK' => t('Falkland Islands'),
+      'FM' => t('Micronesia'),
+      'FO' => t('Faroe Islands'),
+      'FR' => t('France'),
+      'GA' => t('Gabon'),
+      'GB' => t('United Kingdom'),
+      'GD' => t('Grenada'),
+      'GE' => t('Georgia'),
+      'GF' => t('French Guiana'),
+      'GG' => t('Guernsey'),
+      'GH' => t('Ghana'),
+      'GI' => t('Gibraltar'),
+      'GL' => t('Greenland'),
+      'GM' => t('Gambia'),
+      'GN' => t('Guinea'),
+      'GP' => t('Guadeloupe'),
+      'GQ' => t('Equatorial Guinea'),
+      'GR' => t('Greece'),
+      'GS' => t('South Georgia & South Sandwich Islands'),
+      'GT' => t('Guatemala'),
+      'GU' => t('Guam'),
+      'GW' => t('Guinea-Bissau'),
+      'GY' => t('Guyana'),
+      'HK' => t('Hong Kong SAR China'),
+      'HM' => t('Heard & McDonald Islands'),
+      'HN' => t('Honduras'),
+      'HR' => t('Croatia'),
+      'HT' => t('Haiti'),
+      'HU' => t('Hungary'),
+      'IC' => t('Canary Islands'),
+      'ID' => t('Indonesia'),
+      'IE' => t('Ireland'),
+      'IL' => t('Israel'),
+      'IM' => t('Isle of Man'),
+      'IN' => t('India'),
+      'IO' => t('British Indian Ocean Territory'),
+      'IQ' => t('Iraq'),
+      'IR' => t('Iran'),
+      'IS' => t('Iceland'),
+      'IT' => t('Italy'),
+      'JE' => t('Jersey'),
+      'JM' => t('Jamaica'),
+      'JO' => t('Jordan'),
+      'JP' => t('Japan'),
+      'KE' => t('Kenya'),
+      'KG' => t('Kyrgyzstan'),
+      'KH' => t('Cambodia'),
+      'KI' => t('Kiribati'),
+      'KM' => t('Comoros'),
+      'KN' => t('St. Kitts & Nevis'),
+      'KP' => t('North Korea'),
+      'KR' => t('South Korea'),
+      'KW' => t('Kuwait'),
+      'KY' => t('Cayman Islands'),
+      'KZ' => t('Kazakhstan'),
+      'LA' => t('Laos'),
+      'LB' => t('Lebanon'),
+      'LC' => t('St. Lucia'),
+      'LI' => t('Liechtenstein'),
+      'LK' => t('Sri Lanka'),
+      'LR' => t('Liberia'),
+      'LS' => t('Lesotho'),
+      'LT' => t('Lithuania'),
+      'LU' => t('Luxembourg'),
+      'LV' => t('Latvia'),
+      'LY' => t('Libya'),
+      'MA' => t('Morocco'),
+      'MC' => t('Monaco'),
+      'MD' => t('Moldova'),
+      'ME' => t('Montenegro'),
+      'MF' => t('St. Martin'),
+      'MG' => t('Madagascar'),
+      'MH' => t('Marshall Islands'),
+      'MK' => t('North Macedonia'),
+      'ML' => t('Mali'),
+      'MM' => t('Myanmar (Burma)'),
+      'MN' => t('Mongolia'),
+      'MO' => t('Macao SAR China'),
+      'MP' => t('Northern Mariana Islands'),
+      'MQ' => t('Martinique'),
+      'MR' => t('Mauritania'),
+      'MS' => t('Montserrat'),
+      'MT' => t('Malta'),
+      'MU' => t('Mauritius'),
+      'MV' => t('Maldives'),
+      'MW' => t('Malawi'),
+      'MX' => t('Mexico'),
+      'MY' => t('Malaysia'),
+      'MZ' => t('Mozambique'),
+      'NA' => t('Namibia'),
+      'NC' => t('New Caledonia'),
+      'NE' => t('Niger'),
+      'NF' => t('Norfolk Island'),
+      'NG' => t('Nigeria'),
+      'NI' => t('Nicaragua'),
+      'NL' => t('Netherlands'),
+      'NO' => t('Norway'),
+      'NP' => t('Nepal'),
+      'NR' => t('Nauru'),
+      'NU' => t('Niue'),
+      'NZ' => t('New Zealand'),
+      'OM' => t('Oman'),
+      'PA' => t('Panama'),
+      'PE' => t('Peru'),
+      'PF' => t('French Polynesia'),
+      'PG' => t('Papua New Guinea'),
+      'PH' => t('Philippines'),
+      'PK' => t('Pakistan'),
+      'PL' => t('Poland'),
+      'PM' => t('St. Pierre & Miquelon'),
+      'PN' => t('Pitcairn Islands'),
+      'PR' => t('Puerto Rico'),
+      'PS' => t('Palestinian Territories'),
+      'PT' => t('Portugal'),
+      'PW' => t('Palau'),
+      'PY' => t('Paraguay'),
+      'QA' => t('Qatar'),
+      'QO' => t('Outlying Oceania'),
+      'RE' => t('Réunion'),
+      'RO' => t('Romania'),
+      'RS' => t('Serbia'),
+      'RU' => t('Russia'),
+      'RW' => t('Rwanda'),
+      'SA' => t('Saudi Arabia'),
+      'SB' => t('Solomon Islands'),
+      'SC' => t('Seychelles'),
+      'SD' => t('Sudan'),
+      'SE' => t('Sweden'),
+      'SG' => t('Singapore'),
+      'SH' => t('St. Helena'),
+      'SI' => t('Slovenia'),
+      'SJ' => t('Svalbard & Jan Mayen'),
+      'SK' => t('Slovakia'),
+      'SL' => t('Sierra Leone'),
+      'SM' => t('San Marino'),
+      'SN' => t('Senegal'),
+      'SO' => t('Somalia'),
+      'SR' => t('Suriname'),
+      'SS' => t('South Sudan'),
+      'ST' => t('São Tomé & Príncipe'),
+      'SV' => t('El Salvador'),
+      'SX' => t('Sint Maarten'),
+      'SY' => t('Syria'),
+      'SZ' => t('Eswatini'),
+      'TA' => t('Tristan da Cunha'),
+      'TC' => t('Turks & Caicos Islands'),
+      'TD' => t('Chad'),
+      'TF' => t('French Southern Territories'),
+      'TG' => t('Togo'),
+      'TH' => t('Thailand'),
+      'TJ' => t('Tajikistan'),
+      'TK' => t('Tokelau'),
+      'TL' => t('Timor-Leste'),
+      'TM' => t('Turkmenistan'),
+      'TN' => t('Tunisia'),
+      'TO' => t('Tonga'),
+      'TR' => t('Turkey'),
+      'TT' => t('Trinidad & Tobago'),
+      'TV' => t('Tuvalu'),
+      'TW' => t('Taiwan'),
+      'TZ' => t('Tanzania'),
+      'UA' => t('Ukraine'),
+      'UG' => t('Uganda'),
+      'UM' => t('U.S. Outlying Islands'),
+      'US' => t('United States'),
+      'UY' => t('Uruguay'),
+      'UZ' => t('Uzbekistan'),
+      'VA' => t('Vatican City'),
+      'VC' => t('St. Vincent & Grenadines'),
+      'VE' => t('Venezuela'),
+      'VG' => t('British Virgin Islands'),
+      'VI' => t('U.S. Virgin Islands'),
+      'VN' => t('Vietnam'),
+      'VU' => t('Vanuatu'),
+      'WF' => t('Wallis & Futuna'),
+      'WS' => t('Samoa'),
+      'XK' => t('Kosovo'),
+      'YE' => t('Yemen'),
+      'YT' => t('Mayotte'),
+      'ZA' => t('South Africa'),
+      'ZM' => t('Zambia'),
+      'ZW' => t('Zimbabwe'),
     ];
     // cSpell:enable
 
@@ -351,33 +310,19 @@ public static function getStandardList($language_id = NULL) {
   /**
    * Get an array of country code => country name pairs, altered by alter hooks.
    *
-   * @param string $language_type
-   *   (optional) The language type; for example, the interface or the content
-   *   language. Defaults to
-   *   \Drupal\Core\Language\LanguageInterface::TYPE_INTERFACE.
-   *
    * @return array
    *   An array of country code => country name pairs.
    *
    * @see \Drupal\Core\Locale\CountryManager::getStandardList()
    */
-  public function getList($language_type = LanguageInterface::TYPE_INTERFACE) {
+  public function getList() {
     // Populate the country list if it is not already populated.
-    $language_id = $this->languageManager
-      ->getCurrentLanguage($language_type)->getId();
-    if (!isset($this->countries[$language_id])) {
-      $this->countries[$language_id] = static::getStandardList($language_id);
-
-      // Sort the list.
-      uasort($this->countries[$language_id], function ($a, $b) use ($language_id) {
-        $a = $this->transliteration->transliterate($a, $language_id);
-        $b = $this->transliteration->transliterate($b, $language_id);
-        return $a <=> $b;
-      });
+    if (!isset($this->countries)) {
+      $this->countries = static::getStandardList();
       $this->moduleHandler->alter('countries', $this->countries);
     }
 
-    return $this->countries[$language_id];
+    return $this->countries;
   }
 
 }
diff --git a/core/scripts/update-countries.sh b/core/scripts/update-countries.sh
index 0daf818a64e4..37504df75185 100755
--- a/core/scripts/update-countries.sh
+++ b/core/scripts/update-countries.sh
@@ -103,10 +103,10 @@ function t($string) {
   // For .po translation file's sake, use double-quotes instead of escaped
   // single-quotes.
   $name = (strpos($name, '\'') !== FALSE ? '"' . $name . '"' : "'" . $name . "'");
-  $out .= '      ' . var_export($code, TRUE) . ' => t(' . $name . ', [], $translation_options),' . "\n";
+  $out .= '      ' . var_export($code, TRUE) . ' => t(' . $name . '),' . "\n";
 }
 
-// Replace the actual PHP code in CountryManager.php.
+// Replace the actual PHP code in standard.inc.
 $file = DRUPAL_ROOT . '/core/lib/Drupal/Core/Locale/CountryManager.php';
 $content = file_get_contents($file);
 $content = preg_replace('/(\$countries = \[\n)(.+?)(^\s+\];)/ms', '$1' . $out . '$3', $content, -1, $count);
diff --git a/core/tests/Drupal/FunctionalTests/Core/Locale/CountryManagerTest.php b/core/tests/Drupal/FunctionalTests/Core/Locale/CountryManagerTest.php
deleted file mode 100644
index ff1d85b80f15..000000000000
--- a/core/tests/Drupal/FunctionalTests/Core/Locale/CountryManagerTest.php
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-
-namespace Drupal\FunctionalTests\Core\Locale;
-
-use Drupal\Core\Language\LanguageInterface;
-use Drupal\Tests\BrowserTestBase;
-
-/**
- * Tests Country Manager functionality.
- *
- * @group CountryManager
- * @covers Drupal\Core\Locale\CountryManager
- */
-class CountryManagerTest extends BrowserTestBase {
-
-  /**
-   * {@inheritdoc}
-   */
-  protected static $modules = [
-    'language',
-    'locale',
-  ];
-
-  /**
-   * {@inheritdoc}
-   */
-  protected $defaultTheme = 'stark';
-
-  /**
-   * {@inheritdoc}
-   */
-  protected $profile = 'minimal';
-
-  /**
-   * Admin user account.
-   *
-   * @var \Drupal\user\Entity\User
-   */
-  protected $adminUser;
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function setUp(): void {
-    parent::setUp();
-    $this->adminUser = $this->drupalCreateUser([], NULL, TRUE);
-    $this->drupalLogin($this->adminUser);
-  }
-
-  /**
-   * Tests the translation of country names.
-   */
-  public function testCountryManagerTranslate() {
-    $countryManager = $this->container->get('country_manager');
-
-    // Add French language.
-    $edit = [
-      'predefined_langcode' => 'fr',
-    ];
-    $this->drupalGet('/admin/config/regional/language/add');
-    $this->submitForm($edit, 'Add language');
-
-    // French country list.
-    $countryList = $countryManager->getStandardList('fr');
-    $this->assertEquals('ES', array_search(
-    // cSpell:disable-next-line
-      'Espagne',
-      $countryList));
-
-    // English country list.
-    $countryList = $countryManager->getStandardList('en');
-    $this->assertEquals('ES', array_search(
-      'Spain',
-      $countryList));
-  }
-
-  /**
-   * Tests sorting of countries.
-   */
-  public function testCountryManagerSort() {
-    $countryManager = $this->container->get('country_manager');
-    $countryList = $countryManager->getList(LanguageInterface::TYPE_INTERFACE);
-    $countryIds = array_keys($countryList);
-    // cSpell:disable-next-line
-    // Fails if Zimbabwe is in front of Ã…land Islands, wrong alphabetical order.
-    $this->assertTrue(array_search('AX', $countryIds)
-      < array_search('ZW', $countryIds));
-  }
-
-}
-- 
GitLab