function ConfigTranslationAddForm::buildForm

Same name and namespace in other branches
  1. 9 core/modules/config_translation/src/Form/ConfigTranslationAddForm.php \Drupal\config_translation\Form\ConfigTranslationAddForm::buildForm()
  2. 8.9.x core/modules/config_translation/src/Form/ConfigTranslationAddForm.php \Drupal\config_translation\Form\ConfigTranslationAddForm::buildForm()
  3. 11.x core/modules/config_translation/src/Form/ConfigTranslationAddForm.php \Drupal\config_translation\Form\ConfigTranslationAddForm::buildForm()

Implements \Drupal\Core\Form\FormInterface::buildForm().

Builds configuration form with metadata and values from the source language.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

\Drupal\Core\Routing\RouteMatchInterface $route_match: (optional) The route match.

string $plugin_id: (optional) The plugin ID of the mapper.

string $langcode: (optional) The language code of the language the form is adding or editing.

Return value

array The form structure.

Overrides ConfigTranslationFormBase::buildForm

File

core/modules/config_translation/src/Form/ConfigTranslationAddForm.php, line 25

Class

ConfigTranslationAddForm
Defines a form for adding configuration translations.

Namespace

Drupal\config_translation\Form

Code

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;
}

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