diff --git a/core/modules/language/src/ConfigurableLanguageManager.php b/core/modules/language/src/ConfigurableLanguageManager.php index 32429e5..e17b3d2 100644 --- a/core/modules/language/src/ConfigurableLanguageManager.php +++ b/core/modules/language/src/ConfigurableLanguageManager.php @@ -290,20 +290,22 @@ public function getLanguages($flags = LanguageInterface::STATE_CONFIGURABLE) { // Initialize the language list with the default language and default // locked languages. These cannot be removed. This serves as a fallback // list if this method is invoked while the language module is installed - // and the configuration entities for languages are not yet fully imported. + // and the configuration entities for languages are not yet fully + // imported. $default = $this->getDefaultLanguage(); $languages = array($default->getId() => $default); $languages += $this->getDefaultLockedLanguages($default->getWeight()); // Load configurable languages on top of the defaults. Ideally this could - // use the entity API to load and instantiate ConfigurableLanguage objects. - // However the entity API depends on the language system, so that would - // result in infinite loops. We use the configuration system directly and - // instantiate runtime Language objects. When language entities are imported - // those cover the default and locked languages, so site-specific - // configuration will prevail over the fallback values. Having them in the - // array already ensures if this is invoked in the middle of importing - // language configuration entities, the defaults are always present. + // use the entity API to load and instantiate ConfigurableLanguage + // objects. However the entity API depends on the language system, so that + // would result in infinite loops. We use the configuration system + // directly and instantiate runtime Language objects. When language + // entities are imported those cover the default and locked languages, so + // site-specific configuration will prevail over the fallback values. + // Having them in the array already ensures if this is invoked in the + // middle of importing language configuration entities, the defaults are + // always present. $config_ids = $this->configFactory->listAll('language.entity.'); foreach ($this->configFactory->loadMultiple($config_ids) as $config) { $data = $config->get();