You are here

protected function MappingSteps::getLanguageList in GatherContent 8.5

Same name and namespace in other branches
  1. 8.4 gathercontent_ui/src/Form/MappingEditSteps/MappingSteps.php \Drupal\gathercontent_ui\Form\MappingEditSteps\MappingSteps::getLanguageList()

Get list of languages as assoc array.

Return value

array Assoc array of languages keyed by lang code, value is language name.

2 calls to MappingSteps::getLanguageList()
MappingStepEdit::getForm in gathercontent_ui/src/Form/MappingEditSteps/MappingStepEdit.php
Returns form array.
MappingStepNew::getForm in gathercontent_ui/src/Form/MappingEditSteps/MappingStepNew.php
Returns form array.

File

gathercontent_ui/src/Form/MappingEditSteps/MappingSteps.php, line 588

Class

MappingSteps
Class MappingSteps.

Namespace

Drupal\gathercontent_ui\Form\MappingEditSteps

Code

protected function getLanguageList() {
  $languages = \Drupal::service('language_manager')
    ->getLanguages(LanguageInterface::STATE_CONFIGURABLE);
  $language_list = [];
  foreach ($languages as $lang_code => $language) {

    /** @var \Drupal\Core\Language\Language $language */
    $language_list[$lang_code] = $language
      ->getName();
  }
  return $language_list;
}