You are here

protected function LingotekManagementFormBase::getAllLanguages in Lingotek Translation 3.4.x

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

Gets all the languages as options.

Return value

array The languages as a valid options array.

1 call to LingotekManagementFormBase::getAllLanguages()
LingotekManagementFormBase::buildForm in src/Form/LingotekManagementFormBase.php
Form constructor.

File

src/Form/LingotekManagementFormBase.php, line 1604

Class

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