You are here

function LingotekContentTranslationForm::submitForm in Lingotek Translation 8

Same name and namespace in other branches
  1. 8.2 src/Form/LingotekContentTranslationForm.php \Drupal\lingotek\Form\LingotekContentTranslationForm::submitForm()
  2. 4.0.x src/Form/LingotekContentTranslationForm.php \Drupal\lingotek\Form\LingotekContentTranslationForm::submitForm()
  3. 3.0.x src/Form/LingotekContentTranslationForm.php \Drupal\lingotek\Form\LingotekContentTranslationForm::submitForm()
  4. 3.1.x src/Form/LingotekContentTranslationForm.php \Drupal\lingotek\Form\LingotekContentTranslationForm::submitForm()
  5. 3.2.x src/Form/LingotekContentTranslationForm.php \Drupal\lingotek\Form\LingotekContentTranslationForm::submitForm()
  6. 3.3.x src/Form/LingotekContentTranslationForm.php \Drupal\lingotek\Form\LingotekContentTranslationForm::submitForm()
  7. 3.4.x src/Form/LingotekContentTranslationForm.php \Drupal\lingotek\Form\LingotekContentTranslationForm::submitForm()
  8. 3.5.x src/Form/LingotekContentTranslationForm.php \Drupal\lingotek\Form\LingotekContentTranslationForm::submitForm()
  9. 3.6.x src/Form/LingotekContentTranslationForm.php \Drupal\lingotek\Form\LingotekContentTranslationForm::submitForm()
  10. 3.7.x src/Form/LingotekContentTranslationForm.php \Drupal\lingotek\Form\LingotekContentTranslationForm::submitForm()
  11. 3.8.x src/Form/LingotekContentTranslationForm.php \Drupal\lingotek\Form\LingotekContentTranslationForm::submitForm()

Form submission handler.

Parameters

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

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

Overrides ConfigFormBase::submitForm

File

src/Form/LingotekContentTranslationForm.php, line 195
Contains \Drupal\lingotek\Form\LingotekContentTranslationForm.

Class

LingotekContentTranslationForm

Namespace

Drupal\lingotek\Form

Code

function submitForm(array &$form, FormStateInterface $form_state) {
  $form_values = $form_state
    ->getValues();
  $entity = $form_values['entity'];
  $selected_langcodes = $form_values['languages'];
  $locales = array();
  foreach ($selected_langcodes as $langcode => $selected) {
    if ($selected) {
      $locale = $this->languageLocaleMapper
        ->getLocaleForLangcode($langcode);
      $locales[] = $locale;
    }
  }
}