You are here

public function LanguageNegotiator::initLanguageManager in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/language/src/LanguageNegotiator.php \Drupal\language\LanguageNegotiator::initLanguageManager()
  2. 10 core/modules/language/src/LanguageNegotiator.php \Drupal\language\LanguageNegotiator::initLanguageManager()

Initializes the injected language manager with the negotiator.

This should be called right after instantiating the negotiator to make it available to the language manager without introducing a circular dependency.

File

core/modules/language/src/LanguageNegotiator.php, line 102

Class

LanguageNegotiator
Class responsible for performing language negotiation.

Namespace

Drupal\language

Code

public function initLanguageManager() {
  $this->languageManager
    ->setNegotiator($this);
}