You are here

public function LanguageNegotiationTest::getLangcode in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTest.php \Drupal\language_test\Plugin\LanguageNegotiation\LanguageNegotiationTest::getLangcode()
  2. 10 core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTest.php \Drupal\language_test\Plugin\LanguageNegotiation\LanguageNegotiationTest::getLangcode()

Performs language negotiation.

Parameters

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

Return value

string A valid language code or FALSE if the negotiation was unsuccessful.

Overrides LanguageNegotiationMethodInterface::getLangcode

File

core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTest.php, line 30

Class

LanguageNegotiationTest
Class for identifying language from a selected language.

Namespace

Drupal\language_test\Plugin\LanguageNegotiation

Code

public function getLangcode(Request $request = NULL) {
  return 'it';
}