function Drupal::translation

Same name in other branches
  1. 9 core/lib/Drupal.php \Drupal::translation()
  2. 8.9.x core/lib/Drupal.php \Drupal::translation()
  3. 10 core/lib/Drupal.php \Drupal::translation()

Returns the string translation service.

Return value

\Drupal\Core\StringTranslation\TranslationManager The string translation manager.

4 calls to Drupal::translation()
DeleteActionTest::testGetDerivativeDefinitions in core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php
@covers \Drupal\Core\Action\Plugin\Action\Derivative\EntityDeleteActionDeriver::getDerivativeDefinitions
DrupalTest::testTranslation in core/tests/Drupal/Tests/Core/DrupalTest.php
Tests the translation() method.
PublishActionTest::testGetDerivativeDefinitions in core/tests/Drupal/KernelTests/Core/Action/PublishActionTest.php
@covers \Drupal\Core\Action\Plugin\Action\Derivative\EntityPublishedActionDeriver::getDerivativeDefinitions
SaveActionTest::testGetDerivativeDefinitions in core/tests/Drupal/KernelTests/Core/Action/SaveActionTest.php
@covers \Drupal\Core\Action\Plugin\Action\Derivative\EntityChangedActionDeriver::getDerivativeDefinitions

File

core/lib/Drupal.php, line 595

Class

Drupal
Static Service Container wrapper.

Code

public static function translation() {
    return static::getContainer()->get('string_translation');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.