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

Returns the string translation service.

Return value

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

16 calls to Drupal::translation()
BlockContentCreationTest::testBlockDelete in core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php
Test deleting a block.
CommentNonNodeTest::performCommentOperation in core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
Performs the specified operation on the specified comment.
CommentTestBase::performCommentOperation in core/modules/comment/tests/src/Functional/CommentTestBase.php
Performs the specified operation on the specified comment.
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.

... See full list

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');
}