$static_cache_id =
$this->
getCurrentLanguage()->
getId();
} if (!
isset($this->languages
[$static_cache_id][$flags])) { // 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.
$default =
$this->
getDefaultLanguage();
$languages =
[$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.