class LanguageRequestSubscriber implements EventSubscriberInterface (View source)

Sets the $request property on the language manager.

Properties

protected ConfigurableLanguageManagerInterface $languageManager

The language manager service.

protected LanguageNegotiatorInterface $negotiator

The language negotiator.

protected TranslatorInterface $translation

The translation service.

protected AccountInterface $currentUser

The current active user.

Methods

__construct(ConfigurableLanguageManagerInterface $language_manager, LanguageNegotiatorInterface $negotiator, TranslatorInterface $translation, AccountInterface $current_user)

Constructs a LanguageRequestSubscriber object.

onKernelRequestLanguage(RequestEvent $event)

Initializes the language manager at the beginning of the request.

onContainerInitializeSubrequestFinished()

Initializes config overrides whenever the service container is rebuilt.

static array
getSubscribedEvents()

Registers the methods in this class that should be listeners.

Details

__construct(ConfigurableLanguageManagerInterface $language_manager, LanguageNegotiatorInterface $negotiator, TranslatorInterface $translation, AccountInterface $current_user)

Constructs a LanguageRequestSubscriber object.

Parameters

ConfigurableLanguageManagerInterface $language_manager

The language manager service.

LanguageNegotiatorInterface $negotiator

The language negotiator.

TranslatorInterface $translation

The translation service.

AccountInterface $current_user

The current active user.

onKernelRequestLanguage(RequestEvent $event)

Initializes the language manager at the beginning of the request.

Parameters

RequestEvent $event

The Event to process.

onContainerInitializeSubrequestFinished()

Initializes config overrides whenever the service container is rebuilt.

static array getSubscribedEvents()

Registers the methods in this class that should be listeners.

Return Value

array

An array of event listener definitions.