ConfigTranslationAddForm.php

Same filename and directory in other branches
  1. 9 core/modules/config_translation/src/Form/ConfigTranslationAddForm.php
  2. 8.9.x core/modules/config_translation/src/Form/ConfigTranslationAddForm.php
  3. 10 core/modules/config_translation/src/Form/ConfigTranslationAddForm.php

Namespace

Drupal\config_translation\Form

File

core/modules/config_translation/src/Form/ConfigTranslationAddForm.php

View source
<?php

namespace Drupal\config_translation\Form;

use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Routing\RouteMatchInterface;

/**
 * Defines a form for adding configuration translations.
 *
 * @internal
 */
class ConfigTranslationAddForm extends ConfigTranslationFormBase {
    
    /**
     * {@inheritdoc}
     */
    public function getFormId() {
        return 'config_translation_add_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('Add @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);
    }

}

Classes

Title Deprecated Summary
ConfigTranslationAddForm Defines a form for adding configuration translations.

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