diff --git a/core/modules/taxonomy/src/TermForm.php b/core/modules/taxonomy/src/TermForm.php index 9da0993..d21a3b1 100644 --- a/core/modules/taxonomy/src/TermForm.php +++ b/core/modules/taxonomy/src/TermForm.php @@ -20,6 +20,14 @@ class TermForm extends ContentEntityForm { */ public function form(array $form, FormStateInterface $form_state) { $term = $this->entity; + + if ($term->isNew()) { + $form['#title'] = $this->t('Add Term'); + } + else { + $form['#title'] = $this->t('Edit ' . $term->label()); + } + $vocab_storage = $this->entityManager->getStorage('taxonomy_vocabulary'); $taxonomy_storage = $this->entityManager->getStorage('taxonomy_term'); $vocabulary = $vocab_storage->load($term->bundle()); diff --git a/core/modules/taxonomy/src/VocabularyForm.php b/core/modules/taxonomy/src/VocabularyForm.php index e175af7..8b1b755 100644 --- a/core/modules/taxonomy/src/VocabularyForm.php +++ b/core/modules/taxonomy/src/VocabularyForm.php @@ -54,7 +54,7 @@ public function form(array $form, FormStateInterface $form_state) { $form['#title'] = $this->t('Add vocabulary'); } else { - $form['#title'] = $this->t('Edit vocabulary'); + $form['#title'] = $this->t('Edit ' . $vocabulary->label()); } $form['name'] = array(