You are here

public function Search::getSupportedLanguages in Google Site Search 8

Get supported languages.

Return value

array An array of supported language objects.

3 calls to Search::getSupportedLanguages()
Search::buildConfigurationForm in src/Plugin/Search/Search.php
Form constructor.
Search::defaultConfiguration in src/Plugin/Search/Search.php
Gets default configuration for this plugin.
Search::submitConfigurationForm in src/Plugin/Search/Search.php
Form submission handler.

File

src/Plugin/Search/Search.php, line 169

Class

Search
Handles search using Google Search Engine.

Namespace

Drupal\gss\Plugin\Search

Code

public function getSupportedLanguages() {
  $languages = [];

  // Special any language.
  $any_langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED;
  $any_language = $this->languageManager
    ->getLanguage($any_langcode);
  if ($any_language) {
    $languages[$any_langcode] = $any_language;
  }

  // Configurable languages.
  $languages += $this->languageManager
    ->getLanguages();
  return $languages;
}