rebuildServices example

$negotiation_changed = TRUE;
        }
        if (empty($url_prefixes[$new_default_langcode])) {
          $negotiation_config->set('url.prefixes.' . $new_default_langcode, '');
          $negotiation_changed = TRUE;
        }
        if ($negotiation_changed) {
          $negotiation_config->save(TRUE);
        }
      }
      // Trigger a container rebuild on the next request by invalidating it.       ConfigurableLanguageManager::rebuildServices();
    }
    elseif ($saved_config->getName() == 'language.types' && $event->isChanged('negotiation')) {
      // If the negotiation configuration changed the language negotiator and       // the language path processor have to be reset so that they regenerate       // the method instances and also sort them accordingly to the new config.       $this->languageNegotiator->reset();
      if (isset($this->pathProcessorLanguage)) {
        $this->pathProcessorLanguage->reset();
      }
    }
  }

  
if (!$this->isLocked() && $language_manager instanceof ConfigurableLanguageManagerInterface && !$this->isSyncing()) {
      $language_manager->updateLockedLanguageWeights();
    }

    // Update URL Prefixes for all languages after the     // LanguageManagerInterface::getLanguages() cache is flushed.     language_negotiation_url_prefixes_update();

    // If after adding this language the site will become multilingual, we need     // to rebuild language services.     if (!$this->preSaveMultilingual && !$update && $language_manager instanceof ConfigurableLanguageManagerInterface) {
      $language_manager::rebuildServices();
    }
    if (!$update) {
      // Install any available language configuration overrides for the language.       \Drupal::service('language.config_factory_override')->installLanguageOverrides($this->id());
    }

    if (!$this->isLocked() && !$update) {
      // Add language to the list of language domains.       $config = \Drupal::configFactory()->getEditable('language.negotiation');
      $domains = $config->get('url.domains');
      $domains[$this->id()] = '';
      
Home | Imprint | This part of the site doesn't use cookies.