You are here

protected function LingotekConfigManagementForm::getAllLanguages in Lingotek Translation 3.8.x

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

Gets all the languages as options.

Return value

array The languages as a valid options array.

File

src/Form/LingotekConfigManagementForm.php, line 1670

Class

LingotekConfigManagementForm
Form for bulk management of content.

Namespace

Drupal\lingotek\Form

Code

protected function getAllLanguages() {
  $languages = $this->languageManager
    ->getLanguages();
  $options = [];
  foreach ($languages as $id => $language) {
    $options[$id] = $language
      ->getName();
  }
  return $options;
}