Version 1
[yaffs-website] / web / core / modules / config_translation / src / Form / ConfigTranslationEditForm.php
diff --git a/web/core/modules/config_translation/src/Form/ConfigTranslationEditForm.php b/web/core/modules/config_translation/src/Form/ConfigTranslationEditForm.php
new file mode 100644 (file)
index 0000000..86a8f1c
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+namespace Drupal\config_translation\Form;
+
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
+
+/**
+ * Defines a form for editing configuration translations.
+ */
+class ConfigTranslationEditForm extends ConfigTranslationFormBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormId() {
+    return 'config_translation_edit_form';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildForm(array $form, FormStateInterface $form_state, RouteMatchInterface $route_match = NULL, $plugin_id = NULL, $langcode = NULL) {
+    $form = parent::buildForm($form, $form_state, $route_match, $plugin_id, $langcode);
+    $form['#title'] = $this->t('Edit @language translation for %label', [
+      '%label' => $this->mapper->getTitle(),
+      '@language' => $this->language->getName(),
+    ]);
+    return $form;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitForm(array &$form, FormStateInterface $form_state) {
+    parent::submitForm($form, $form_state);
+    drupal_set_message($this->t('Successfully updated @language translation.', ['@language' => $this->language->getName()]));
+  }
+
+}