ConfigurableLanguageManager::getStandardLanguageListWithoutConfigured

public 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 460

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;
}
doc_Drupal
2016-10-29 08:55:17
Comments
Leave a Comment

Please login to continue.