8.3.x StringTranslationTrait.php public StringTranslationTrait::setStringTranslation(TranslationInterface $translation)
8.0.x StringTranslationTrait.php public StringTranslationTrait::setStringTranslation(TranslationInterface $translation)
8.1.x StringTranslationTrait.php public StringTranslationTrait::setStringTranslation(TranslationInterface $translation)
8.2.x StringTranslationTrait.php public StringTranslationTrait::setStringTranslation(TranslationInterface $translation)
8.4.x StringTranslationTrait.php public StringTranslationTrait::setStringTranslation(TranslationInterface $translation)

Sets the string translation service to use.

Parameters

\Drupal\Core\StringTranslation\TranslationInterface $translation: The string translation service.

Return value

$this

3 calls to StringTranslationTrait::setStringTranslation()
BreakpointManager::__construct in core/modules/breakpoint/src/BreakpointManager.php
Constructs a new BreakpointManager instance.
EntityViewsData::__construct in core/modules/views/src/EntityViewsData.php
Constructs an EntityViewsData object.
ForumBreadcrumbBuilderBase::__construct in core/modules/forum/src/Breadcrumb/ForumBreadcrumbBuilderBase.php
Constructs a forum breadcrumb builder object.
2 methods override StringTranslationTrait::setStringTranslation()
TestMigrateExecutable::setStringTranslation in core/modules/migrate/tests/src/Unit/TestMigrateExecutable.php
Sets the string translation service.
TestPathBasedBreadcrumbBuilder::setStringTranslation in core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php
Sets the string translation service to use.

File

core/lib/Drupal/Core/StringTranslation/StringTranslationTrait.php, line 118

Class

StringTranslationTrait
Wrapper methods for \Drupal\Core\StringTranslation\TranslationInterface.

Namespace

Drupal\Core\StringTranslation

Code

public function setStringTranslation(TranslationInterface $translation) {
  $this->stringTranslation = $translation;

  return $this;
}