function ContentTranslateForm::validateForm

File

sources/content/src/Form/ContentTranslateForm.php, line 117

Class

ContentTranslateForm

Namespace

Drupal\tmgmt_content\Form

Code

function validateForm(array &$form, FormStateInterface $form_state) {
  $selected = array_filter($form_state
    ->getValue('languages'));
  if (empty($selected)) {
    $form_state
      ->setErrorByName('languages', $this
      ->t('You have to select at least one language for requesting a translation.'));
  }
}