Version 1
[yaffs-website] / web / core / modules / content_translation / src / Form / ContentTranslationDeleteForm.php
diff --git a/web/core/modules/content_translation/src/Form/ContentTranslationDeleteForm.php b/web/core/modules/content_translation/src/Form/ContentTranslationDeleteForm.php
new file mode 100644 (file)
index 0000000..9d225dc
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+namespace Drupal\content_translation\Form;
+
+use Drupal\Core\Entity\ContentEntityDeleteForm;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Language\LanguageInterface;
+
+/**
+ * Delete translation form for content_translation module.
+ */
+class ContentTranslationDeleteForm extends ContentEntityDeleteForm {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormId() {
+    return 'content_translation_delete_confirm';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  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);
+  }
+
+}