ConfigTranslationEditForm.php 1.19 KB
Newer Older
1 2 3 4 5 6 7 8 9
<?php

/**
 * @file
 * Contains \Drupal\config_translation\Form\ConfigTranslationEditForm.
 */

namespace Drupal\config_translation\Form;

10
use Drupal\Core\Form\FormStateInterface;
11 12 13
use Symfony\Component\HttpFoundation\Request;

/**
14
 * Defines a form for editing configuration translations.
15 16 17 18 19 20 21 22 23 24 25 26 27
 */
class ConfigTranslationEditForm extends ConfigTranslationFormBase {

  /**
   * {@inheritdoc}
   */
  public function getFormId() {
    return 'config_translation_edit_form';
  }

  /**
   * {@inheritdoc}
   */
28
  public function buildForm(array $form, FormStateInterface $form_state, Request $request = NULL, $plugin_id = NULL, $langcode = NULL) {
29 30 31
    $form = parent::buildForm($form, $form_state, $request, $plugin_id, $langcode);
    $form['#title'] = $this->t('Edit @language translation for %label', array(
      '%label' => $this->mapper->getTitle(),
32
      '@language' => $this->language->getName(),
33 34 35 36 37 38 39
    ));
    return $form;
  }

  /**
   * {@inheritdoc}
   */
40
  public function submitForm(array &$form, FormStateInterface $form_state) {
41
    parent::submitForm($form, $form_state);
42
    drupal_set_message($this->t('Successfully updated @language translation.', array('@language' => $this->language->getName())));
43
  }
44

45
}