You are here

public function LanguageRequestSubscriber::__construct in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/language/src/EventSubscriber/LanguageRequestSubscriber.php \Drupal\language\EventSubscriber\LanguageRequestSubscriber::__construct()
  2. 9 core/modules/language/src/EventSubscriber/LanguageRequestSubscriber.php \Drupal\language\EventSubscriber\LanguageRequestSubscriber::__construct()

Constructs a LanguageRequestSubscriber object.

Parameters

\Drupal\language\ConfigurableLanguageManagerInterface $language_manager: The language manager service.

\Drupal\language\LanguageNegotiatorInterface $negotiator: The language negotiator.

\Drupal\Core\StringTranslation\Translator\TranslatorInterface $translation: The translation service.

\Drupal\Core\Session\AccountInterface $current_user: The current active user.

File

core/modules/language/src/EventSubscriber/LanguageRequestSubscriber.php, line 59

Class

LanguageRequestSubscriber
Sets the $request property on the language manager.

Namespace

Drupal\language\EventSubscriber

Code

public function __construct(ConfigurableLanguageManagerInterface $language_manager, LanguageNegotiatorInterface $negotiator, TranslatorInterface $translation, AccountInterface $current_user) {
  $this->languageManager = $language_manager;
  $this->negotiator = $negotiator;
  $this->translation = $translation;
  $this->currentUser = $current_user;
}