diff --git a/core/modules/language/src/ConfigurableLanguageManager.php b/core/modules/language/src/ConfigurableLanguageManager.php index 59d6d54..a2f103e 100644 --- a/core/modules/language/src/ConfigurableLanguageManager.php +++ b/core/modules/language/src/ConfigurableLanguageManager.php @@ -97,9 +97,9 @@ class ConfigurableLanguageManager extends LanguageManager implements Configurabl /** * Whether already in the process of language initialization. * - * @var bool + * @var array */ - protected $initializing = FALSE; + protected $initializing = []; /** * {@inheritdoc} @@ -217,13 +217,18 @@ public function getCurrentLanguage($type = LanguageInterface::TYPE_INTERFACE) { // Ensure we have a valid value for this language type. $this->negotiatedLanguages[$type] = $this->getDefaultLanguage(); + // Ensure that the initalizing array is properly set up for any keys. + if (!isset($this->initializing[$type])) { + $this->initializing[$type] = FALSE; + } + if ($this->negotiator && $this->isMultilingual()) { - if (!$this->initializing) { - $this->initializing = TRUE; + if (!$this->initializing[$type]) { + $this->initializing[$type] = TRUE; $negotiation = $this->negotiator->initializeType($type); $this->negotiatedLanguages[$type] = reset($negotiation); $this->negotiatedMethods[$type] = key($negotiation); - $this->initializing = FALSE; + $this->initializing[$type] = FALSE; } // If the current interface language needs to be retrieved during // initialization we return the system language. This way string