diff --git a/core/modules/language/src/Entity/ConfigurableLanguage.php b/core/modules/language/src/Entity/ConfigurableLanguage.php index 4c458a0..d029714 100644 --- a/core/modules/language/src/Entity/ConfigurableLanguage.php +++ b/core/modules/language/src/Entity/ConfigurableLanguage.php @@ -124,7 +124,8 @@ public function preSave(EntityStorageInterface $storage) { // When adding a new language the weight shouldn't be zero to avoid a // reordering of the languages list when their names change i.e. interface - // translation. + // translation. The english language is special cased because it is provided + // as default configuration with a valid weight of 0. if ($this->id != 'en' && $this->isNew() && !$this->isLocked() && $this->getWeight() == 0) { // Fetch all configurable languages ordered by weight. $languages = \Drupal::languageManager()->getLanguages($this::STATE_CONFIGURABLE); diff --git a/core/modules/language/src/Tests/LanguageListTest.php b/core/modules/language/src/Tests/LanguageListTest.php index 1c9ac28..22a638f 100644 --- a/core/modules/language/src/Tests/LanguageListTest.php +++ b/core/modules/language/src/Tests/LanguageListTest.php @@ -48,7 +48,7 @@ function testLanguageList() { $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE])); // Get the weight of the last language and check that the weight is one unit - // heavier and that is French. + // heavier and than the last configurable language. $this->rebuildContainer(); $languages = \Drupal::service('language_manager')->getLanguages(); $last_language = end($languages);