public function StringTranslationTrait::setStringTranslation in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/StringTranslation/StringTranslationTrait.php \Drupal\Core\StringTranslation\StringTranslationTrait::setStringTranslation()
- 9 core/lib/Drupal/Core/StringTranslation/StringTranslationTrait.php \Drupal\Core\StringTranslation\StringTranslationTrait::setStringTranslation()
Sets the string translation service to use.
Parameters
\Drupal\Core\StringTranslation\TranslationInterface $translation: The string translation service.
Return value
$this
2 calls to StringTranslationTrait::setStringTranslation()
- BreakpointManager::__construct in core/
modules/ breakpoint/ src/ BreakpointManager.php - Constructs a new BreakpointManager instance.
- ForumBreadcrumbBuilderBase::__construct in core/
modules/ forum/ src/ Breadcrumb/ ForumBreadcrumbBuilderBase.php - Constructs a forum breadcrumb builder object.
1 method overrides StringTranslationTrait::setStringTranslation()
- TestMigrateExecutable::setStringTranslation in core/
modules/ migrate/ tests/ src/ Unit/ TestMigrateExecutable.php - Sets the string translation service.
File
- core/
lib/ Drupal/ Core/ StringTranslation/ StringTranslationTrait.php, line 118
Class
- StringTranslationTrait
- Wrapper methods for \Drupal\Core\StringTranslation\TranslationInterface.
Namespace
Drupal\Core\StringTranslationCode
public function setStringTranslation(TranslationInterface $translation) {
$this->stringTranslation = $translation;
return $this;
}