class TestTranslationManager in Drupal 9
Same name in this branch
- 9 core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php \Drupal\Tests\Core\StringTranslation\TestTranslationManager
- 9 core/modules/user/tests/src/Unit/PermissionHandlerTest.php \Drupal\Tests\user\Unit\TestTranslationManager
Same name and namespace in other branches
- 8 core/modules/user/tests/src/Unit/PermissionHandlerTest.php \Drupal\Tests\user\Unit\TestTranslationManager
Implements a translation manager in tests.
Hierarchy
- class \Drupal\Tests\user\Unit\TestTranslationManager implements TranslationInterface
Expanded class hierarchy of TestTranslationManager
File
- core/
modules/ user/ tests/ src/ Unit/ PermissionHandlerTest.php, line 391 - Contains \Drupal\Tests\user\Unit\PermissionHandlerTest.
Namespace
Drupal\Tests\user\UnitView source
class TestTranslationManager implements TranslationInterface {
/**
* {@inheritdoc}
*/
public function translate($string, array $args = [], array $options = []) {
return new TranslatableMarkup($string, $args, $options, $this);
}
/**
* {@inheritdoc}
*/
public function translateString(TranslatableMarkup $translated_string) {
return $translated_string
->getUntranslatedString();
}
/**
* {@inheritdoc}
*/
public function formatPlural($count, $singular, $plural, array $args = [], array $options = []) {
return new PluralTranslatableMarkup($count, $singular, $plural, $args, $options, $this);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TestTranslationManager:: |
public | function |
Formats a string containing a count of items. Overrides TranslationInterface:: |
|
TestTranslationManager:: |
public | function |
Translates a string to the current language or to a given language. Overrides TranslationInterface:: |
|
TestTranslationManager:: |
public | function |
Translates a TranslatableMarkup object to a string. Overrides TranslationInterface:: |