class LanguageNegotiationUI in Zircon Profile 8
Same name and namespace in other branches
- 8.0 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 LanguageNegotiationMethodInterface
- class \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUI
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/ src/ Tests/ LanguageNegotiationInfoTest.php - Contains \Drupal\language\Tests\LanguageNegotiationInfoTest.
- LanguageNegotiator.php in core/
modules/ language/ src/ LanguageNegotiator.php - Contains \Drupal\language\LanguageNegotiator.
- 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 24 - Contains \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUI.
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;
}
}