You are here

public function ConfigurableLanguageManager::getStandardLanguageListWithoutConfigured in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/language/src/ConfigurableLanguageManager.php \Drupal\language\ConfigurableLanguageManager::getStandardLanguageListWithoutConfigured()
  2. 10 core/modules/language/src/ConfigurableLanguageManager.php \Drupal\language\ConfigurableLanguageManager::getStandardLanguageListWithoutConfigured()

Returns the standard language list excluding already configured languages.

Return value

array A list of standard language names keyed by langcode.

Overrides ConfigurableLanguageManagerInterface::getStandardLanguageListWithoutConfigured

File

core/modules/language/src/ConfigurableLanguageManager.php, line 465

Class

ConfigurableLanguageManager
Overrides default LanguageManager to provide configured languages.

Namespace

Drupal\language

Code

public function getStandardLanguageListWithoutConfigured() {
  $languages = $this
    ->getLanguages();
  $predefined = $this
    ->getStandardLanguageList();
  foreach ($predefined as $key => $value) {
    if (isset($languages[$key])) {
      unset($predefined[$key]);
      continue;
    }
    $predefined[$key] = new TranslatableMarkup($value[0]);
  }
  natcasesort($predefined);
  return $predefined;
}