You are here

public function StringTranslationTrait::setStringTranslation in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 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.
EntityViewsData::__construct in core/modules/views/src/EntityViewsData.php
Constructs an EntityViewsData 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 125
Contains \Drupal\Core\StringTranslation\StringTranslationTrait.

Class

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

Namespace

Drupal\Core\StringTranslation

Code

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