LocaleDefaultConfigStorage::predefinedConfiguredLanguages

protected LocaleDefaultConfigStorage::predefinedConfiguredLanguages()

Compute the list of configuration names that match predefined languages.

Return value

array The list of configuration names that match predefined languages.

File

core/modules/locale/src/LocaleDefaultConfigStorage.php, line 147

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);
}
doc_Drupal
2016-10-29 09:24:02
Comments
Leave a Comment

Please login to continue.