Pull merge.
[yaffs-website] / web / core / modules / language / src / ConfigurableLanguageManager.php
index de64c4423a7c87ad3d6fe58eaceff5a89be42e92..25927b52532c789b818f96a2a87f8a9de12c9893 100644 (file)
@@ -90,11 +90,11 @@ class ConfigurableLanguageManager extends LanguageManager implements Configurabl
   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}
@@ -213,12 +213,12 @@ class ConfigurableLanguageManager extends LanguageManager implements Configurabl
       $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
@@ -426,7 +426,12 @@ class ConfigurableLanguageManager extends LanguageManager implements Configurabl
   }
 
   /**
-   * {@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);