You are here

protected function LocaleDefaultConfigStorage::predefinedConfiguredLanguages in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/locale/src/LocaleDefaultConfigStorage.php \Drupal\locale\LocaleDefaultConfigStorage::predefinedConfiguredLanguages()

Compute the list of configuration names that match predefined languages.

Return value

array The list of configuration names that match predefined languages.

2 calls to LocaleDefaultConfigStorage::predefinedConfiguredLanguages()
LocaleDefaultConfigStorage::getComponentNames in core/modules/locale/src/LocaleDefaultConfigStorage.php
Get all configuration names and folders for a list of modules or themes.
LocaleDefaultConfigStorage::listAll in core/modules/locale/src/LocaleDefaultConfigStorage.php
Return the list of configuration in install storage and current languages.

File

core/modules/locale/src/LocaleDefaultConfigStorage.php, line 152
Contains \Drupal\locale\LocaleDefaultConfigStorage.

Class

LocaleDefaultConfigStorage
Provides access to default configuration for locale integration.

Namespace

Drupal\locale

Code

protected function predefinedConfiguredLanguages() {
  $names = $this->configStorage
    ->listAll('language.entity.');
  $predefined_languages = $this->languageManager
    ->getStandardLanguageList();
  foreach ($names as $id => $name) {
    $langcode = str_replace('language.entity.', '', $name);
    if (!isset($predefined_languages[$langcode])) {
      unset($names[$id]);
    }
  }
  return array_values($names);
}