ContentTranslationDeleteForm.php in Drupal 9
File
core/modules/content_translation/src/Form/ContentTranslationDeleteForm.php
View source
<?php
namespace Drupal\content_translation\Form;
use Drupal\Core\Entity\ContentEntityDeleteForm;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Language\LanguageInterface;
class ContentTranslationDeleteForm extends ContentEntityDeleteForm {
public function getFormId() {
return 'content_translation_delete_confirm';
}
public function buildForm(array $form, FormStateInterface $form_state, LanguageInterface $language = NULL) {
if ($language) {
$form_state
->set('langcode', $language
->getId());
}
return parent::buildForm($form, $form_state);
}
}