You are here

public static function Drupal::translation in Drupal 10

Same name and namespace in other branches
  1. 8 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.

36 calls to Drupal::translation()
BatchUserAction::finishBatch in core/modules/views/tests/modules/user_batch_action_test/src/Plugin/Action/BatchUserAction.php
Finish batch.
comment_node_search_result in core/modules/comment/comment.module
Implements hook_node_search_result().
ConfigImporterFieldPurger::process in core/modules/field/src/ConfigImporterFieldPurger.php
Processes fields targeted for purge as part of a configuration sync.
content_moderation_workspace_access in core/modules/content_moderation/content_moderation.module
Implements hook_ENTITY_TYPE_access() for the 'workspace' entity type.
DeleteActionTest::testGetDerivativeDefinitions in core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php
@covers \Drupal\Core\Action\Plugin\Action\Derivative\EntityDeleteActionDeriver::getDerivativeDefinitions

... See full list

File

core/lib/Drupal.php, line 582

Class

Drupal
Static Service Container wrapper.

Code

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