LanguageNegotiationBrowser
class LanguageNegotiationBrowser extends LanguageNegotiationMethodBase implements ContainerFactoryPluginInterface (View source)
Class for identifying language from the browser Accept-language HTTP header.
Constants
| METHOD_ID |
The language negotiation method id. |
Properties
| protected LanguageManagerInterface | $languageManager | The language manager. |
from LanguageNegotiationMethodBase |
| protected ConfigFactoryInterface | $config | The configuration factory. |
from LanguageNegotiationMethodBase |
| protected AccountInterface | $currentUser | The current active user. |
from LanguageNegotiationMethodBase |
| protected KillSwitch | $pageCacheKillSwitch | The page cache disabling policy. |
Methods
Injects the language manager.
Notifies the plugin that the language code it returned has been accepted.
Creates an instance of the plugin.
Performs language negotiation.
Details
setLanguageManager(ConfigurableLanguageManagerInterface $language_manager)
Injects the language manager.
setConfig(ConfigFactoryInterface $config)
Injects the configuration factory.
setCurrentUser(AccountInterface $current_user)
Injects the current user.
persist(LanguageInterface $language)
Notifies the plugin that the language code it returned has been accepted.
static ContainerFactoryPluginInterface
create(ContainerInterface $container, array $configuration, string $plugin_id, mixed $plugin_definition)
Creates an instance of the plugin.
string
getLangcode(Request $request = NULL)
Performs language negotiation.