You are here

public function Language::languageOptions in GoogleTagManager 8

Returns associative array of language names keyed by language ID.

Return value

array The associative array of language names keyed by language ID.

1 call to Language::languageOptions()
Language::__construct in src/Plugin/Condition/Language.php
Constructs a language condition plugin.

File

src/Plugin/Condition/Language.php, line 105

Class

Language
Provides a 'Language' condition.

Namespace

Drupal\google_tag\Plugin\Condition

Code

public function languageOptions() {
  $options = [];
  if ($this->languageManager
    ->isMultilingual()) {
    $languages = $this->languageManager
      ->getLanguages();
    foreach ($languages as $language) {
      $options[$language
        ->getId()] = $language
        ->getName();
    }
  }
  return $options;
}