Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LanguageNegotiationUI.php

function 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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal