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

Breadcrumb

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

function LanguageNegotiationSelected::getLangcode

Overrides LanguageNegotiationMethodInterface::getLangcode

File

core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSelected.php, line 30

Class

LanguageNegotiationSelected
Class for identifying language from a selected language.

Namespace

Drupal\language\Plugin\LanguageNegotiation

Code

public function getLangcode(?Request $request = NULL) {
    $langcode = NULL;
    if ($this->languageManager) {
        $langcode = $this->config
            ->get('language.negotiation')
            ->get('selected_langcode');
    }
    return $langcode;
}

API Navigation

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