class LanguageNegotiationTest in Drupal 10
Same name in this branch
- 10 core/modules/language/tests/src/Unit/process/LanguageNegotiationTest.php \Drupal\Tests\language\Unit\process\LanguageNegotiationTest
- 10 core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTest.php \Drupal\language_test\Plugin\LanguageNegotiation\LanguageNegotiationTest
Same name and namespace in other branches
- 8 core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTest.php \Drupal\language_test\Plugin\LanguageNegotiation\LanguageNegotiationTest
- 9 core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTest.php \Drupal\language_test\Plugin\LanguageNegotiation\LanguageNegotiationTest
Class for identifying language from a selected language.
Plugin annotation
@LanguageNegotiation(
id = "test_language_negotiation_method",
weight = -10,
name = @Translation("Test"),
description = @Translation("This is a test language negotiation method."),
types = {Drupal\Core\Language\LanguageInterface::TYPE_CONTENT,
"test_language_type", "fixed_test_language_type"}
)
Hierarchy
- class \Drupal\language\LanguageNegotiationMethodBase implements LanguageNegotiationMethodInterface
- class \Drupal\language_test\Plugin\LanguageNegotiation\LanguageNegotiationTest
Expanded class hierarchy of LanguageNegotiationTest
File
- core/
modules/ language/ tests/ language_test/ src/ Plugin/ LanguageNegotiation/ LanguageNegotiationTest.php, line 20
Namespace
Drupal\language_test\Plugin\LanguageNegotiationView source
class LanguageNegotiationTest extends LanguageNegotiationMethodBase {
/**
* The language negotiation method id.
*/
const METHOD_ID = 'test_language_negotiation_method';
/**
* {@inheritdoc}
*/
public function getLangcode(Request $request = NULL) {
return 'it';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LanguageNegotiationMethodBase:: |
protected | property | The configuration factory. | |
LanguageNegotiationMethodBase:: |
protected | property | The current active user. | |
LanguageNegotiationMethodBase:: |
protected | property | The language manager. | |
LanguageNegotiationMethodBase:: |
public | function | ||
LanguageNegotiationMethodBase:: |
public | function | ||
LanguageNegotiationMethodBase:: |
public | function | ||
LanguageNegotiationMethodBase:: |
public | function | ||
LanguageNegotiationTest:: |
public | function |
Performs language negotiation. Overrides LanguageNegotiationMethodInterface:: |
|
LanguageNegotiationTest:: |
constant | The language negotiation method id. |