function ContentEntityDeleteForm::getQuestion

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php \Drupal\Core\Entity\ContentEntityDeleteForm::getQuestion()
  2. 10 core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php \Drupal\Core\Entity\ContentEntityDeleteForm::getQuestion()
  3. 11.x core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php \Drupal\Core\Entity\ContentEntityDeleteForm::getQuestion()

Overrides ConfirmFormInterface::getQuestion

File

core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php, line 128

Class

ContentEntityDeleteForm
Provides a generic base class for a content entity deletion form.

Namespace

Drupal\Core\Entity

Code

public function getQuestion() {
    
    /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
    $entity = $this->getEntity();
    if (!$entity->isDefaultTranslation()) {
        return $this->t('Are you sure you want to delete the @language translation of the @entity-type %label?', [
            '@language' => $entity->language()
                ->getName(),
            '@entity-type' => $this->getEntity()
                ->getEntityType()
                ->getSingularLabel(),
            '%label' => $this->getEntity()
                ->label(),
        ]);
    }
    return $this->traitGetQuestion();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.