protected function LocaleDefaultConfigStorage::predefinedConfiguredLanguages in Drupal 10
Same name and namespace in other branches
- 8 core/modules/locale/src/LocaleDefaultConfigStorage.php \Drupal\locale\LocaleDefaultConfigStorage::predefinedConfiguredLanguages()
- 9 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.
File
- core/
modules/ locale/ src/ LocaleDefaultConfigStorage.php, line 149
Class
- LocaleDefaultConfigStorage
- Provides access to default configuration for locale integration.
Namespace
Drupal\localeCode
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);
}