function LanguageNegotiationUI::getLangcode

Same name and namespace in other branches
  1. 9 core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUI.php \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUI::getLangcode()
  2. 8.9.x core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUI.php \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUI::getLangcode()
  3. 10 core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUI.php \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUI::getLangcode()

Overrides LanguageNegotiationMethodInterface::getLangcode

File

core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUI.php, line 31

Class

LanguageNegotiationUI
Identifies the language from the interface text language selected for page.

Namespace

Drupal\language\Plugin\LanguageNegotiation

Code

public function getLangcode(?Request $request = NULL) {
    return $this->languageManager ? $this->languageManager
        ->getCurrentLanguage()
        ->getId() : NULL;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.