Drupal 8  8.0.2
LanguageNegotiationUser Class Reference
Inheritance diagram for LanguageNegotiationUser:

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-user'
 

Additional Inherited Members

- Protected Attributes inherited from LanguageNegotiationMethodBase
 $languageManager
 
 $config
 
 $currentUser
 

Detailed Description

Class for identifying language from the user preferences.

( id = ::METHOD_ID, weight = -4, name = ("User"), description = ("Follow the user's language preference.") )

Member Function Documentation

getLangcode ( Request  $request = NULL)

{Performs language negotiation.

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

Implements LanguageNegotiationMethodInterface.

References Drupal\currentUser(), and Drupal\languageManager().

Here is the call graph for this function:

Field Documentation

const METHOD_ID = 'language-user'

The language negotiation method id.

Referenced by LanguageUILanguageNegotiationTest\testUILanguageNegotiation().


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