public function TranslatorForm::validateForm

File

src/Form/TranslatorForm.php, line 231

Class

TranslatorForm
Form controller for the translator edit forms.

Namespace

Drupal\tmgmt\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  parent::validateForm($form, $form_state);
  if (!$form_state
    ->getValue('plugin')) {
    $form_state
      ->setErrorByName('plugin', $this
      ->t('You have to select a translator plugin.'));
  }
  $plugin_ui = $this->translatorManager
    ->createUIInstance($this->entity
    ->getPluginID());
  $plugin_ui
    ->validateConfigurationForm($form, $form_state);
}