protected $initialized = FALSE;
/**
- * Whether already in the process of language initialization.
+ * Whether language types are in the process of language initialization.
*
- * @var bool
+ * @var bool[]
*/
- protected $initializing = FALSE;
+ protected $initializing = [];
/**
* {@inheritdoc}
$this->negotiatedLanguages[$type] = $this->getDefaultLanguage();
if ($this->negotiator && $this->isMultilingual()) {
- if (!$this->initializing) {
- $this->initializing = TRUE;
+ if (!isset($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;
+ unset($this->initializing[$type]);
}
// If the current interface language needs to be retrieved during
// initialization we return the system language. This way string
}
/**
- * {@inheritdoc}
+ * Sets the configuration override language.
+ *
+ * @param \Drupal\Core\Language\LanguageInterface $language
+ * The language to override configuration with.
+ *
+ * @return $this
*/
public function setConfigOverrideLanguage(LanguageInterface $language = NULL) {
$this->configFactoryOverride->setLanguage($language);