function LanguageNegotiationMethodInterface::getLangcode

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

Performs language negotiation.

@todo Determine whether string|false or string|null should be the normalized result across all implementations and update the

Parameters

\Symfony\Component\HttpFoundation\Request $request: (optional) The current request. Defaults to NULL if it has not been initialized yet.

Return value

string|null|false A valid language code if the negotiation was successful and either NULL or FALSE otherwise.

and its comment accordingly.

See also

https://www.drupal.org/node/3329952

10 methods override LanguageNegotiationMethodInterface::getLangcode()
LanguageNegotiationBrowser::getLangcode in core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationBrowser.php
Performs language negotiation.
LanguageNegotiationContentEntity::getLangcode in core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php
Performs language negotiation.
LanguageNegotiationSelected::getLangcode in core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSelected.php
Performs language negotiation.
LanguageNegotiationSession::getLangcode in core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSession.php
Performs language negotiation.
LanguageNegotiationTest::getLangcode in core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTest.php
Performs language negotiation.

... See full list

File

core/modules/language/src/LanguageNegotiationMethodInterface.php, line 57

Class

LanguageNegotiationMethodInterface
Interface for language negotiation classes.

Namespace

Drupal\language

Code

public function getLangcode(?Request $request = NULL);

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