Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. StringTranslationTrait.php

function StringTranslationTrait::setStringTranslation

Sets the string translation service to use.

Parameters

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

Return value

$this

4 calls to StringTranslationTrait::setStringTranslation()
BreakpointManager::__construct in core/modules/breakpoint/src/BreakpointManager.php
Constructs a new BreakpointManager instance.
EntityRevisionViewController::__construct in core/lib/Drupal/Core/Entity/Controller/EntityRevisionViewController.php
Creates a new EntityRevisionViewController.
EntityViewsData::__construct in core/modules/views/src/EntityViewsData.php
Constructs an EntityViewsData object.
InstallProfileUninstallValidator::__construct in core/lib/Drupal/Core/Extension/InstallProfileUninstallValidator.php

File

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

Class

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

Namespace

Drupal\Core\StringTranslation

Code

public function setStringTranslation(TranslationInterface $translation) {
    $this->stringTranslation = $translation;
    return $this;
}
RSS feed
Powered by Drupal