You are here

public static function Drupal::translation in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal.php \Drupal::translation()

Returns the string translation service.

Return value

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

5 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
_simpletest_build_summary_line in core/modules/simpletest/simpletest.module
Formats each test result type pluralized summary.

File

core/lib/Drupal.php, line 636
Contains \Drupal.

Class

Drupal
Static Service Container wrapper.

Code

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