class TestTranslationManager
Same name in this branch
- 10 core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php \Drupal\Tests\Core\StringTranslation\TestTranslationManager
Same name in other branches
- 9 core/modules/user/tests/src/Unit/PermissionHandlerTest.php \Drupal\Tests\user\Unit\TestTranslationManager
- 9 core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php \Drupal\Tests\Core\StringTranslation\TestTranslationManager
- 8.9.x core/modules/user/tests/src/Unit/PermissionHandlerTest.php \Drupal\Tests\user\Unit\TestTranslationManager
- 8.9.x core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php \Drupal\Tests\Core\StringTranslation\TestTranslationManager
- 11.x core/modules/user/tests/src/Unit/PermissionHandlerTest.php \Drupal\Tests\user\Unit\TestTranslationManager
- 11.x core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php \Drupal\Tests\Core\StringTranslation\TestTranslationManager
Implements a translation manager in tests.
Hierarchy
- class \Drupal\Tests\user\Unit\TestTranslationManager implements \Drupal\Core\StringTranslation\TranslationInterface
Expanded class hierarchy of TestTranslationManager
File
-
core/
modules/ user/ tests/ src/ Unit/ PermissionHandlerTest.php, line 385
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
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
TestTranslationManager::formatPlural | public | function | |
TestTranslationManager::translate | public | function | |
TestTranslationManager::translateString | public | function |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.