diff --git a/core/modules/language/src/Form/LanguageAddForm.php b/core/modules/language/src/Form/LanguageAddForm.php index d44ce16..f0b1029 100644 --- a/core/modules/language/src/Form/LanguageAddForm.php +++ b/core/modules/language/src/Form/LanguageAddForm.php @@ -159,8 +159,8 @@ protected function copyFormValuesToEntity(EntityInterface $entity, array $form, $entity->set('id', $langcode); $entity->set('label', $label); $entity->set('direction', $direction); - // There is no weight on in the edit form. - // Fetch all configurable languages ordered by weight. + // There is no weight on the edit form. Fetch all configurable languages + // ordered by weight and set the new language to be placed after them. $languages = \Drupal::languageManager()->getLanguages(ConfigurableLanguage::STATE_CONFIGURABLE); $last_language = end($languages); $entity->setWeight($last_language->getWeight() + 1);