Drupal 8  8.0.2
LanguageNegotiationBrowser Class Reference
Inheritance diagram for LanguageNegotiationBrowser:

Public Member Functions

 getLangcode (Request $request=NULL)
- Public Member Functions inherited from LanguageNegotiationMethodBase
 setLanguageManager (ConfigurableLanguageManagerInterface $language_manager)
 setConfig (ConfigFactoryInterface $config)
 setCurrentUser (AccountInterface $current_user)
 persist (LanguageInterface $language)

Data Fields

const METHOD_ID = 'language-browser'

Additional Inherited Members

- Protected Attributes inherited from LanguageNegotiationMethodBase

Detailed Description

Class for identifying language from the browser Accept-language HTTP header.

( id = ::METHOD_ID, weight = -2, name = ("Browser"), description = ("Language from the browser's language settings."), config_route_name = "language.negotiation_browser" )

Member Function Documentation

getLangcode ( Request  $request = NULL)

{Performs language negotiation.

\Symfony\Component\HttpFoundation\Request$request(optional) The current request. Defaults to NULL if it has not been initialized yet.
string A valid language code or FALSE if the negotiation was unsuccessful.

Implements LanguageNegotiationMethodInterface.

References Drupal\config(), UserAgent\getBestMatchingLangcode(), Drupal\languageManager(), and Drupal\service().

Here is the call graph for this function:

Field Documentation

const METHOD_ID = 'language-browser'

The language negotiation method id.

Referenced by LanguageUILanguageNegotiationTest\testUILanguageNegotiation().

The documentation for this class was generated from the following file: