class LanguageNegotiationUI
Same name in other branches
- 8.9.x core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUI.php \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUI
- 10 core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUI.php \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUI
- 11.x core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUI.php \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUI
Identifies the language from the interface text language selected for page.
Plugin annotation
@LanguageNegotiation(
id = Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUI::METHOD_ID,
types = {Drupal\Core\Language\LanguageInterface::TYPE_CONTENT},
weight = 9,
name = @Translation("Interface"),
description = @Translation("Use the detected interface language.")
)
Hierarchy
- class \Drupal\language\LanguageNegotiationMethodBase implements \Drupal\language\LanguageNegotiationMethodInterface
- class \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUI extends \Drupal\language\LanguageNegotiationMethodBase
Expanded class hierarchy of LanguageNegotiationUI
4 files declare their use of LanguageNegotiationUI
- language.module in core/
modules/ language/ language.module - Add language handling functionality to Drupal.
- LanguageNegotiationInfoTest.php in core/
modules/ language/ tests/ src/ Functional/ LanguageNegotiationInfoTest.php - LanguageNegotiator.php in core/
modules/ language/ src/ LanguageNegotiator.php - language_test.module in core/
modules/ language/ tests/ language_test/ language_test.module - Mock module for language layer tests.
File
-
core/
modules/ language/ src/ Plugin/ LanguageNegotiation/ LanguageNegotiationUI.php, line 19
Namespace
Drupal\language\Plugin\LanguageNegotiationView source
class LanguageNegotiationUI extends LanguageNegotiationMethodBase {
/**
* The language negotiation method id.
*/
const METHOD_ID = 'language-interface';
/**
* {@inheritdoc}
*/
public function getLangcode(Request $request = NULL) {
return $this->languageManager ? $this->languageManager
->getCurrentLanguage()
->getId() : NULL;
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.