diff --git a/core/modules/comment/tests/src/Kernel/CommentValidationTest.php b/core/modules/comment/tests/src/Kernel/CommentValidationTest.php
index e2630fc9365b1f1df1c3b4f4ad80e8c148f60305..e5792aef3d938997dd53e7958a7b392653f9488f 100644
--- a/core/modules/comment/tests/src/Kernel/CommentValidationTest.php
+++ b/core/modules/comment/tests/src/Kernel/CommentValidationTest.php
@@ -271,10 +271,7 @@ public function testValidationOfCommentOfUnpublishedNode() {
     $violations = $node2->validate();
     $this->assertCount(1, $violations);
     $this->assertEquals('entity_reference_comment.0.target_id', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('This entity (%type: %name) cannot be referenced.', [
-      '%type' => $comment1->getEntityTypeId(),
-      '%name' => $comment1->id(),
-    ]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('This entity (%s: %s) cannot be referenced.', $comment1->getEntityTypeId(), $comment1->id()), $violations[0]->getMessage());
 
     $this->drupalSetCurrentUser($comment_admin_user);
     $this->assertEquals(\Drupal::currentUser()->id(), $comment_admin_user->id());
diff --git a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
index 7f8b1090dc079687948b3de2c55d76c6ab3b702e..16592853717a9765beb1bd3758623745ee9e5e94 100644
--- a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
+++ b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
@@ -336,7 +336,7 @@ public function testSiteWideContact() {
     $this->submitForm($edit, 'Send message');
     $mails = $this->getMails();
     $mail = array_pop($mails);
-    $this->assertEquals(t('[@label] @subject', ['@label' => $label, '@subject' => $edit['subject[0][value]']]), $mail['subject']);
+    $this->assertEquals(sprintf('[%s] %s', $label, $edit['subject[0][value]']), $mail['subject']);
     $this->assertStringContainsString($field_label, $mail['body']);
     $this->assertStringContainsString($edit[$field_name . '[0][value]'], $mail['body']);
 
diff --git a/core/modules/field/tests/src/Kernel/FieldCrudTest.php b/core/modules/field/tests/src/Kernel/FieldCrudTest.php
index 66087c97076c809f16d56f020a0e32bd6702388d..7ba79f70aae9c17076dc81fe3f78ee6528e9299e 100644
--- a/core/modules/field/tests/src/Kernel/FieldCrudTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldCrudTest.php
@@ -183,10 +183,10 @@ protected function doFieldPropertyConstraintsTests() {
     $this->assertCount(2, $violations, 'Two violations found when using a null and outside the range value.');
 
     $this->assertEquals($field_name . '.0.value', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('%name does not accept the value @value.', ['%name' => $field_name, '@value' => -2]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('%s does not accept the value -2.', $field_name), $violations[0]->getMessage());
 
     $this->assertEquals($field_name . '.0.value', $violations[1]->getPropertyPath());
-    $this->assertEquals(t('This value should be between %min and %max.', ['%min' => 0, '%max' => 32]), $violations[1]->getMessage());
+    $this->assertEquals('This value should be between 0 and 32.', $violations[1]->getMessage());
 
     // Check that a value that is not specifically restricted but outside the
     // range triggers the expected violation.
@@ -194,7 +194,7 @@ protected function doFieldPropertyConstraintsTests() {
     $violations = $entity->validate();
     $this->assertCount(1, $violations, 'Violations found when using value outside the range.');
     $this->assertEquals($field_name . '.0.value', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('This value should be between %min and %max.', ['%min' => 0, '%max' => 32]), $violations[0]->getMessage());
+    $this->assertEquals('This value should be between 0 and 32.', $violations[0]->getMessage());
   }
 
   /**
diff --git a/core/modules/field/tests/src/Kernel/FieldValidationTest.php b/core/modules/field/tests/src/Kernel/FieldValidationTest.php
index d91d12bf42649229145d7c153bc0d39edd8299a5..a898358afa3e1009b92c2e75769c1666ceff6fc4 100644
--- a/core/modules/field/tests/src/Kernel/FieldValidationTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldValidationTest.php
@@ -59,7 +59,7 @@ public function testCardinalityConstraint() {
     // Check that the expected constraint violations are reported.
     $this->assertCount(1, $violations);
     $this->assertEquals('', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('%name: this field cannot hold more than @count values.', ['%name' => $this->fieldTestData->field->getLabel(), '@count' => $cardinality]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('%s: this field cannot hold more than %s values.', $this->fieldTestData->field->getLabel(), $cardinality), $violations[0]->getMessage());
   }
 
   /**
diff --git a/core/modules/file/tests/src/Kernel/SaveTest.php b/core/modules/file/tests/src/Kernel/SaveTest.php
index 67ba4329b3c96947ebd26be61141e4748aebab4c..55a84cee63e26e647de404323ab0105c831bad01 100644
--- a/core/modules/file/tests/src/Kernel/SaveTest.php
+++ b/core/modules/file/tests/src/Kernel/SaveTest.php
@@ -74,7 +74,7 @@ public function testFileSave() {
     file_put_contents($uppercase_file_duplicate->getFileUri(), 'hello world');
     $violations = $uppercase_file_duplicate->validate();
     $this->assertCount(1, $violations);
-    $this->assertEquals(t('The file %value already exists. Enter a unique file URI.', ['%value' => $uppercase_file_duplicate->getFileUri()]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('The file %s already exists. Enter a unique file URI.', $uppercase_file_duplicate->getFileUri()), $violations[0]->getMessage());
     // Ensure that file URI entity queries are case sensitive.
     $fids = \Drupal::entityQuery('file')
       ->accessCheck(FALSE)
diff --git a/core/modules/forum/tests/src/Kernel/ForumValidationTest.php b/core/modules/forum/tests/src/Kernel/ForumValidationTest.php
index 03672adeb6c3121215fc2ab94a184574dcb1b6c6..e7e52e285ba44b3e048c457cca415f0923a5a449 100644
--- a/core/modules/forum/tests/src/Kernel/ForumValidationTest.php
+++ b/core/modules/forum/tests/src/Kernel/ForumValidationTest.php
@@ -65,7 +65,7 @@ public function testValidation() {
     $forum_post->set('taxonomy_forums', $container);
     $violations = $forum_post->validate();
     $this->assertCount(1, $violations);
-    $this->assertEquals(t('The item %forum is a forum container, not a forum. Select one of the forums below instead.', ['%forum' => $container->label()]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('The item %s is a forum container, not a forum. Select one of the forums below instead.', $container->label()), $violations[0]->getMessage());
   }
 
 }
diff --git a/core/modules/taxonomy/tests/src/Kernel/TermValidationTest.php b/core/modules/taxonomy/tests/src/Kernel/TermValidationTest.php
index 3d15da19c12bdd9aa74135bbe030e8154e40fa13..09995268bf88823042dfdc040e63f262f037d023 100644
--- a/core/modules/taxonomy/tests/src/Kernel/TermValidationTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/TermValidationTest.php
@@ -47,7 +47,7 @@ public function testValidation() {
     $this->assertCount(1, $violations, 'Violation found when name is too long.');
     $this->assertEquals('name.0.value', $violations[0]->getPropertyPath());
     $field_label = $term->get('name')->getFieldDefinition()->getLabel();
-    $this->assertEquals(t('%name: may not be longer than @max characters.', ['%name' => $field_label, '@max' => 255]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('%s: may not be longer than 255 characters.', $field_label), $violations[0]->getMessage());
 
     $term->set('name', NULL);
     $violations = $term->validate();
diff --git a/core/modules/user/tests/src/Functional/Views/BulkFormTest.php b/core/modules/user/tests/src/Functional/Views/BulkFormTest.php
index 8ec5b249c34ced65e895ebf0aef6ff7c3eb19839..c7a72a40478065daa5c24b75ee4542d37ed8b9f4 100644
--- a/core/modules/user/tests/src/Functional/Views/BulkFormTest.php
+++ b/core/modules/user/tests/src/Functional/Views/BulkFormTest.php
@@ -147,7 +147,7 @@ public function testBulkFormCombineFilter() {
     User::load($this->users[0]->id());
     $view = Views::getView('test_user_bulk_form_combine_filter');
     $errors = $view->validate();
-    $this->assertEquals(t('Field %field set in %filter is not usable for this filter type. Combined field filter only works for simple fields.', ['%field' => 'User: Bulk update', '%filter' => 'Global: Combine fields filter']), reset($errors['default']));
+    $this->assertEquals(sprintf('Field User: Bulk update set in Global: Combine fields filter is not usable for this filter type. Combined field filter only works for simple fields.'), reset($errors['default']));
   }
 
 }
diff --git a/core/modules/user/tests/src/Kernel/UserValidationTest.php b/core/modules/user/tests/src/Kernel/UserValidationTest.php
index 79c594cf8d232b0dd134350455cba25e4880f6e9..f2fc70bca60af91e2d5b4a7751ded6ab9b1656b2 100644
--- a/core/modules/user/tests/src/Kernel/UserValidationTest.php
+++ b/core/modules/user/tests/src/Kernel/UserValidationTest.php
@@ -92,7 +92,7 @@ public function testValidation() {
     $violations = $user->validate();
     $this->assertCount(1, $violations, 'Violation found when name is too long.');
     $this->assertEquals('name', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('The username %name is too long: it must be %max characters or less.', ['%name' => $name, '%max' => 60]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('The username %s is too long: it must be 60 characters or less.', $name), $violations[0]->getMessage());
 
     // Create a second test user to provoke a name collision.
     $user2 = User::create([
@@ -104,7 +104,7 @@ public function testValidation() {
     $violations = $user->validate();
     $this->assertCount(1, $violations, 'Violation found on name collision.');
     $this->assertEquals('name', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('The username %name is already taken.', ['%name' => 'existing']), $violations[0]->getMessage());
+    $this->assertEquals('The username existing is already taken.', $violations[0]->getMessage());
 
     // Make the name valid.
     $user->set('name', $this->randomMachineName());
@@ -124,7 +124,7 @@ public function testValidation() {
     //   https://www.drupal.org/node/2023465.
     $this->assertCount(2, $violations, 'Violations found when email is too long');
     $this->assertEquals('mail.0.value', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('%name: the email address can not be longer than @max characters.', ['%name' => $user->get('mail')->getFieldDefinition()->getLabel(), '@max' => Email::EMAIL_MAX_LENGTH]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('%s: the email address can not be longer than %s characters.', $user->get('mail')->getFieldDefinition()->getLabel(), Email::EMAIL_MAX_LENGTH), $violations[0]->getMessage());
     $this->assertEquals('mail.0.value', $violations[1]->getPropertyPath());
     $this->assertEquals('This value is not a valid email address.', $violations[1]->getMessage());
 
@@ -133,12 +133,12 @@ public function testValidation() {
     $violations = $user->validate();
     $this->assertCount(1, $violations, 'Violation found when email already exists.');
     $this->assertEquals('mail', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('The email address %mail is already taken.', ['%mail' => 'existing@example.com']), $violations[0]->getMessage());
+    $this->assertEquals('The email address existing@example.com is already taken.', $violations[0]->getMessage());
     $user->set('mail', NULL);
     $violations = $user->validate();
     $this->assertCount(1, $violations, 'Email addresses may not be removed');
     $this->assertEquals('mail', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('@name field is required.', ['@name' => $user->getFieldDefinition('mail')->getLabel()]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('%s field is required.', $user->getFieldDefinition('mail')->getLabel()), $violations[0]->getMessage());
     $user->set('mail', 'someone@example.com');
 
     $user->set('timezone', $this->randomString(33));
@@ -181,7 +181,7 @@ public function testValidation() {
     $violations = $user->validate();
     $this->assertCount(1, $violations);
     $this->assertEquals('roles.1.target_id', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('The referenced entity (%entity_type: %name) does not exist.', ['%entity_type' => 'user_role', '%name' => 'unknown_role']), $violations[0]->getMessage());
+    $this->assertEquals('The referenced entity (user_role: unknown_role) does not exist.', $violations[0]->getMessage());
   }
 
   /**
@@ -205,7 +205,7 @@ protected function assertLengthViolation(EntityInterface $entity, string $field_
     $this->assertCount($count, $violations, "Violation found when $field_name is too long.");
     $this->assertEquals("{$field_name}.0.value", $violations[$expected_index]->getPropertyPath());
     $field_label = $entity->get($field_name)->getFieldDefinition()->getLabel();
-    $this->assertEquals(t('%name: may not be longer than @max characters.', ['%name' => $field_label, '@max' => $length]), $violations[$expected_index]->getMessage());
+    $this->assertEquals(sprintf('%s: may not be longer than %s characters.', $field_label, $length), $violations[$expected_index]->getMessage());
   }
 
   /**
diff --git a/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php b/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php
index 3afeafd0559a84594a90a2f0581b93d9df5cecfa..0d5ddaa59eaa255674efcba7734ee4ae06573f5b 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php
@@ -241,7 +241,7 @@ public function testFilterCombineContainsFieldsOverwritten() {
     $this->assertTrue($view->build_info['fail'], "View build has been marked as failed.");
     // Make sure this view does not pass validation with the right error.
     $errors = $view->validate();
-    $this->assertEquals(t('Field %field set in %filter is not set in display %display.', ['%field' => 'dummy', '%filter' => 'Global: Combine fields filter', '%display' => 'Default']), reset($errors['default']));
+    $this->assertEquals('Field dummy set in Global: Combine fields filter is not set in display Default.', reset($errors['default']));
   }
 
   /**
@@ -275,7 +275,7 @@ public function testNonFieldsRow() {
     $this->executeView($view);
     $errors = $view->validate();
     // Check that the right error is shown.
-    $this->assertEquals(t('%display: %filter can only be used on displays that use fields. Set the style or row format for that display to one using fields to use the combine field filter.', ['%filter' => 'Global: Combine fields filter', '%display' => 'Default']), reset($errors['default']));
+    $this->assertEquals('Default: Global: Combine fields filter can only be used on displays that use fields. Set the style or row format for that display to one using fields to use the combine field filter.', reset($errors['default']));
 
     // Confirm that the query with single filter does not use the "CONCAT_WS"
     // operator.
diff --git a/core/tests/Drupal/KernelTests/Core/Element/PathElementFormTest.php b/core/tests/Drupal/KernelTests/Core/Element/PathElementFormTest.php
index 088bd65893afcc4bc23816d8534bacb570cadc0a..cc32f641714b605c7abe22fb5f47fbec76982300 100644
--- a/core/tests/Drupal/KernelTests/Core/Element/PathElementFormTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Element/PathElementFormTest.php
@@ -178,7 +178,7 @@ public function testPathElement() {
     $errors = $form_state->getErrors();
     // Should be missing 'required_validate' field.
     $this->assertCount(1, $errors);
-    $this->assertEquals(['required_validate' => t('@name field is required.', ['@name' => 'required_validate'])], $errors);
+    $this->assertEquals(['required_validate' => 'required_validate field is required.'], $errors);
 
     // Test invalid required parameters.
     $form_state = (new FormState())
@@ -194,10 +194,10 @@ public function testPathElement() {
     $errors = $form_state->getErrors();
     $this->assertCount(4, $errors);
     $this->assertEquals([
-      'required_validate' => t('This path does not exist or you do not have permission to link to %path.', ['%path' => 'user/74']),
-      'required_validate_route' => t('This path does not exist or you do not have permission to link to %path.', ['%path' => 'user/74']),
-      'required_validate_url' => t('This path does not exist or you do not have permission to link to %path.', ['%path' => 'user/74']),
-      'required_non_validate' => t('@name field is required.', ['@name' => 'required_non_validate']),
+      'required_validate' => 'This path does not exist or you do not have permission to link to user/74.',
+      'required_validate_route' => 'This path does not exist or you do not have permission to link to user/74.',
+      'required_validate_url' => 'This path does not exist or you do not have permission to link to user/74.',
+      'required_non_validate' => 'required_non_validate field is required.',
     ], $errors);
 
     // Test invalid optional parameters.
@@ -216,8 +216,8 @@ public function testPathElement() {
     $errors = $form_state->getErrors();
     $this->assertEquals(count($errors), 2);
     $this->assertEquals($errors, [
-      'optional_validate' => t('This path does not exist or you do not have permission to link to %path.', ['%path' => 'user/74']),
-      'optional_validate_route' => t('This path does not exist or you do not have permission to link to %path.', ['%path' => 'user/74']),
+      'optional_validate' => 'This path does not exist or you do not have permission to link to user/74.',
+      'optional_validate_route' => 'This path does not exist or you do not have permission to link to user/74.',
     ]);
   }
 
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/BundleConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/Entity/BundleConstraintValidatorTest.php
index 03f764aa9b88663593fad26b7fe50f13d931ef1c..42185dbd8248cc2c703b499650541b43174e05d2 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/BundleConstraintValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/BundleConstraintValidatorTest.php
@@ -69,7 +69,7 @@ protected function assertValidation($bundle): void {
 
     // Make sure the information provided by a violation is correct.
     $violation = $violations[0];
-    $this->assertEquals(t('The entity must be of bundle %bundle.', ['%bundle' => implode(', ', (array) $bundle)]), $violation->getMessage(), 'The message for invalid value is correct.');
+    $this->assertEquals(sprintf('The entity must be of bundle %s.', implode(', ', (array) $bundle)), $violation->getMessage(), 'The message for invalid value is correct.');
     $this->assertEquals($typed_data, $violation->getRoot(), 'Violation root is correct.');
     $this->assertEquals($page_node, $violation->getInvalidValue(), 'The invalid value is set correctly in the violation.');
   }
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/Element/EntityAutocompleteElementFormTest.php b/core/tests/Drupal/KernelTests/Core/Entity/Element/EntityAutocompleteElementFormTest.php
index 107ec0e7a30624cf190dcbec8c432c6d4617ae03..e2f7780e95c3e2db876f2837ac8fdbf3ab4fe0e7 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/Element/EntityAutocompleteElementFormTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/Element/EntityAutocompleteElementFormTest.php
@@ -286,7 +286,7 @@ public function testInvalidEntityAutocompleteElement() {
       ]);
     $form_builder->submitForm($this, $form_state);
     $this->assertCount(1, $form_state->getErrors());
-    $this->assertEquals(t('There are no test entity entities matching "%value".', ['%value' => 'single - non-existent label']), $form_state->getErrors()['single']);
+    $this->assertEquals('There are no test entity entities matching "single - non-existent label".', $form_state->getErrors()['single']);
 
     // Test 'single' with an entity ID that doesn't exist.
     $form_state = (new FormState())
@@ -295,7 +295,7 @@ public function testInvalidEntityAutocompleteElement() {
       ]);
     $form_builder->submitForm($this, $form_state);
     $this->assertCount(1, $form_state->getErrors());
-    $this->assertEquals(t('The referenced entity (%type: %id) does not exist.', ['%type' => 'entity_test', '%id' => 42]), $form_state->getErrors()['single']);
+    $this->assertEquals('The referenced entity (entity_test: 42) does not exist.', $form_state->getErrors()['single']);
 
     // Do the same tests as above but on an element with '#validate_reference'
     // set to FALSE.
@@ -309,7 +309,7 @@ public function testInvalidEntityAutocompleteElement() {
     // The element without 'autocreate' support still has to emit a warning when
     // the input doesn't end with an entity ID enclosed in parentheses.
     $this->assertCount(1, $form_state->getErrors());
-    $this->assertEquals(t('There are no test entity entities matching "%value".', ['%value' => 'single - non-existent label']), $form_state->getErrors()['single_no_validate']);
+    $this->assertEquals('There are no test entity entities matching "single - non-existent label".', $form_state->getErrors()['single_no_validate']);
 
     $form_state = (new FormState())
       ->setValues([
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php
index 7ed01db2666d86a45fee24b89a8faaded7c1e1f6..8926a825042f13a0c7d59dce58212a3a75705ddf 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php
@@ -105,7 +105,7 @@ public function testEntityReferenceFieldValidation() {
     $entity->{$this->fieldName}->target_id = 9999;
     $violations = $entity->{$this->fieldName}->validate();
     $this->assertEquals(1, $violations->count(), 'Validation throws a violation.');
-    $this->assertEquals(t('The referenced entity (%type: %id) does not exist.', ['%type' => $this->referencedEntityType, '%id' => 9999]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('The referenced entity (%s: 9999) does not exist.', $this->referencedEntityType), $violations[0]->getMessage());
 
     // Test a non-referenceable bundle.
     entity_test_create_bundle('non_referenceable', NULL, $this->referencedEntityType);
@@ -116,7 +116,7 @@ public function testEntityReferenceFieldValidation() {
     $entity->{$this->fieldName}->target_id = $referenced_entity->id();
     $violations = $entity->{$this->fieldName}->validate();
     $this->assertEquals(1, $violations->count(), 'Validation throws a violation.');
-    $this->assertEquals(t('This entity (%type: %id) cannot be referenced.', ['%type' => $this->referencedEntityType, '%id' => $referenced_entity->id()]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('This entity (%s: %s) cannot be referenced.', $this->referencedEntityType, $referenced_entity->id()), $violations[0]->getMessage());
   }
 
   /**
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintValidatorTest.php
index 8e2a87d9f0d1580c35156d57cc40bb8dd33f7537..72bb469367718bfd5bd382d77bd0bc3a26d8bc30 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintValidatorTest.php
@@ -56,7 +56,7 @@ public function testValidation() {
 
     // Make sure the information provided by a violation is correct.
     $violation = $violations[0];
-    $this->assertEquals(t('The entity must be of type %type.', ['%type' => $entity_type]), $violation->getMessage(), 'The message for invalid value is correct.');
+    $this->assertEquals(sprintf('The entity must be of type %s.', $entity_type), $violation->getMessage(), 'The message for invalid value is correct.');
     $this->assertEquals($typed_data, $violation->getRoot(), 'Violation root is correct.');
     $this->assertEquals($account, $violation->getInvalidValue(), 'The invalid value is set correctly in the violation.');
   }
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php
index 7218e99135c5a99adbe077ebfc64ae1eab4749d3..c58116475f8318ba1165189b8580c568cced043c 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php
@@ -140,13 +140,13 @@ protected function checkValidation($entity_type) {
     $test_entity->id->value = -1;
     $violations = $test_entity->validate();
     $this->assertEquals(1, $violations->count(), 'Validation failed.');
-    $this->assertEquals(t('%name: The integer must be larger or equal to %min.', ['%name' => 'ID', '%min' => 0]), $violations[0]->getMessage());
+    $this->assertEquals('ID: The integer must be larger or equal to 0.', $violations[0]->getMessage());
 
     $test_entity = clone $entity;
     $test_entity->uuid->value = $this->randomString(129);
     $violations = $test_entity->validate();
     $this->assertEquals(1, $violations->count(), 'Validation failed.');
-    $this->assertEquals(t('%name: may not be longer than @max characters.', ['%name' => 'UUID', '@max' => 128]), $violations[0]->getMessage());
+    $this->assertEquals('UUID: may not be longer than 128 characters.', $violations[0]->getMessage());
 
     $test_entity = clone $entity;
     $langcode_key = $this->entityTypeManager->getDefinition($entity_type)->getKey('langcode');
@@ -154,7 +154,7 @@ protected function checkValidation($entity_type) {
     $violations = $test_entity->validate();
     // This should fail on AllowedValues and Length constraints.
     $this->assertEquals(2, $violations->count(), 'Validation failed.');
-    $this->assertEquals(t('This value is too long. It should have %limit characters or less.', ['%limit' => '12']), $violations[0]->getMessage());
+    $this->assertEquals('This value is too long. It should have 12 characters or less.', $violations[0]->getMessage());
     $this->assertEquals('The value you selected is not a valid choice.', $violations[1]->getMessage());
 
     $test_entity = clone $entity;
@@ -167,7 +167,7 @@ protected function checkValidation($entity_type) {
     $test_entity->name->value = $this->randomString(65);
     $violations = $test_entity->validate();
     $this->assertEquals(1, $violations->count(), 'Validation failed.');
-    $this->assertEquals(t('%name: may not be longer than @max characters.', ['%name' => 'Name', '@max' => 64]), $violations[0]->getMessage());
+    $this->assertEquals('Name: may not be longer than 64 characters.', $violations[0]->getMessage());
 
     // Make sure the information provided by a violation is correct.
     $violation = $violations[0];
@@ -179,7 +179,7 @@ protected function checkValidation($entity_type) {
     $test_entity->set('user_id', 9999);
     $violations = $test_entity->validate();
     $this->assertEquals(1, $violations->count(), 'Validation failed.');
-    $this->assertEquals(t('The referenced entity (%type: %id) does not exist.', ['%type' => 'user', '%id' => 9999]), $violations[0]->getMessage());
+    $this->assertEquals('The referenced entity (user: 9999) does not exist.', $violations[0]->getMessage());
 
     $test_entity = clone $entity;
     $test_entity->field_test_text->format = $this->randomString(33);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ValidReferenceConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ValidReferenceConstraintValidatorTest.php
index 4b5ae1853b2e6672668674b8596231d97890515e..2372fb9a449576dba1ea8e1cdb1d15779ec24509 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/ValidReferenceConstraintValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/ValidReferenceConstraintValidatorTest.php
@@ -76,7 +76,7 @@ public function testValidation() {
 
     // Make sure the information provided by a violation is correct.
     $violation = $violations[0];
-    $this->assertEquals(t('The referenced entity (%type: %id) does not exist.', ['%type' => 'user', '%id' => $entity->id()]), $violation->getMessage(), 'The message for invalid value is correct.');
+    $this->assertEquals(sprintf('The referenced entity (user: %s) does not exist.', $entity->id()), $violation->getMessage(), 'The message for invalid value is correct.');
     $this->assertEquals($typed_data, $violation->getRoot(), 'Violation root is correct.');
   }
 
@@ -163,10 +163,7 @@ public function testPreExistingItemsValidation() {
 
     $violations = $referencing_entity->field_test->validate();
     $this->assertCount(1, $violations);
-    $this->assertEquals(t('This entity (%type: %id) cannot be referenced.', [
-      '%type' => 'node',
-      '%id' => $unpublished_node->id(),
-    ]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('This entity (node: %s) cannot be referenced.', $unpublished_node->id()), $violations[0]->getMessage());
 
     // Now save the referencing entity which will create a pre-existing state
     // for it and repeat the checks. This time, the user without access should
@@ -207,10 +204,7 @@ public function testPreExistingItemsValidation() {
 
     $violations = $referencing_entity->field_test->validate();
     $this->assertCount(1, $violations);
-    $this->assertEquals(t('This entity (%type: %id) cannot be referenced.', [
-      '%type' => 'node',
-      '%id' => $different_bundle_node->id(),
-    ]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('This entity (node: %s) cannot be referenced.', $different_bundle_node->id()), $violations[0]->getMessage());
 
     // Delete the last node and check that the pre-existing reference is not
     // valid anymore.
@@ -218,14 +212,8 @@ public function testPreExistingItemsValidation() {
 
     $violations = $referencing_entity->field_test->validate();
     $this->assertCount(2, $violations);
-    $this->assertEquals(t('This entity (%type: %id) cannot be referenced.', [
-      '%type' => 'node',
-      '%id' => $different_bundle_node->id(),
-    ]), $violations[0]->getMessage());
-    $this->assertEquals(t('The referenced entity (%type: %id) does not exist.', [
-      '%type' => 'node',
-      '%id' => $deleted_node->id(),
-    ]), $violations[1]->getMessage());
+    $this->assertEquals(sprintf('This entity (node: %s) cannot be referenced.', $different_bundle_node->id()), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('The referenced entity (node: %s) does not exist.', $deleted_node->id()), $violations[1]->getMessage());
   }
 
 }
diff --git a/core/tests/Drupal/KernelTests/Core/Validation/UniqueValuesConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/Validation/UniqueValuesConstraintValidatorTest.php
index 4616e0c53eeb3087536bcbca2e0916188c254682..7bfd326bc204cd0afacb64d9359fb0ca0ffb5053 100644
--- a/core/tests/Drupal/KernelTests/Core/Validation/UniqueValuesConstraintValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Validation/UniqueValuesConstraintValidatorTest.php
@@ -84,9 +84,7 @@ public function testValidation() {
     $violations = $entity->validate();
     $this->assertCount(1, $violations);
     $this->assertEquals('field_test_text.2', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('A unique field entity with unique_field_test %value already exists.', [
-      '%value' => $value,
-    ]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('A unique field entity with unique_field_test %s already exists.', $value), $violations[0]->getMessage());
 
     // Create another entity with two values, but one value is existing.
     $definition = [
@@ -101,9 +99,7 @@ public function testValidation() {
     $violations = $entity->validate();
     $this->assertCount(1, $violations);
     $this->assertEquals('field_test_text.1', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('A unique field entity with unique_field_test %value already exists.', [
-      '%value' => $definition['field_test_text'][1],
-    ]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('A unique field entity with unique_field_test %s already exists.', $definition['field_test_text'][1]), $violations[0]->getMessage());
 
   }
 
@@ -135,9 +131,7 @@ public function testValidationReference() {
     $violations = $entity->validate();
     $this->assertCount(1, $violations);
     $this->assertEquals('field_test_reference.1', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('A unique field entity with unique_reference_test %value already exists.', [
-      '%value' => $definition['field_test_reference'][1],
-    ]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('A unique field entity with unique_reference_test %s already exists.', $definition['field_test_reference'][1]), $violations[0]->getMessage());
 
     // Create entity with two references for the testing field.
     $definition = [
@@ -181,9 +175,7 @@ public function testValidationReference() {
     $violations = $entity->validate();
     $this->assertCount(1, $violations);
     $this->assertEquals('field_test_reference.1', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('A unique field entity with unique_reference_test %value already exists.', [
-      '%value' => $definition['field_test_reference'][1],
-    ]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('A unique field entity with unique_reference_test %s already exists.', $definition['field_test_reference'][1]), $violations[0]->getMessage());
 
   }
 
@@ -209,9 +201,7 @@ public function testValidationOwn() {
     $violations = $entity->validate();
     $this->assertCount(1, $violations);
     $this->assertEquals('field_test_text.1', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('A unique field entity with unique_field_test %value already exists.', [
-      '%value' => $definition['field_test_text'][1],
-    ]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('A unique field entity with unique_field_test %s already exists.', $definition['field_test_text'][1]), $violations[0]->getMessage());
 
     // Create entity with two different values for the testing field.
     $definition = [
@@ -233,9 +223,7 @@ public function testValidationOwn() {
     $violations = $entity->validate();
     $this->assertCount(1, $violations);
     $this->assertEquals('field_test_text.2', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('A unique field entity with unique_field_test %value already exists.', [
-      '%value' => $definition['field_test_text'][0],
-    ]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('A unique field entity with unique_field_test %s already exists.', $definition['field_test_text'][0]), $violations[0]->getMessage());
 
   }
 
@@ -277,13 +265,9 @@ public function testValidationMultiple() {
     $violations = $entity->validate();
     $this->assertCount(2, $violations);
     $this->assertEquals('field_test_text.1', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('A unique field entity with unique_field_test %value already exists.', [
-      '%value' => $definition['field_test_text'][1],
-    ]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('A unique field entity with unique_field_test %s already exists.', $definition['field_test_text'][1]), $violations[0]->getMessage());
     $this->assertEquals('field_test_text.2', $violations[1]->getPropertyPath());
-    $this->assertEquals(t('A unique field entity with unique_field_test %value already exists.', [
-      '%value' => $definition['field_test_text'][2],
-    ]), $violations[1]->getMessage());
+    $this->assertEquals(sprintf('A unique field entity with unique_field_test %s already exists.', $definition['field_test_text'][2]), $violations[1]->getMessage());
 
     // Create new entity with two identical values and one existing value in unique field.
     $definition = [
@@ -298,13 +282,9 @@ public function testValidationMultiple() {
     $violations = $entity->validate();
     $this->assertCount(2, $violations);
     $this->assertEquals('field_test_text.1', $violations[0]->getPropertyPath());
-    $this->assertEquals(t('A unique field entity with unique_field_test %value already exists.', [
-      '%value' => $definition['field_test_text'][1],
-    ]), $violations[0]->getMessage());
+    $this->assertEquals(sprintf('A unique field entity with unique_field_test %s already exists.', $definition['field_test_text'][1]), $violations[0]->getMessage());
     $this->assertEquals('field_test_text.2', $violations[1]->getPropertyPath());
-    $this->assertEquals(t('A unique field entity with unique_field_test %value already exists.', [
-      '%value' => $definition['field_test_text'][2],
-    ]), $violations[1]->getMessage());
+    $this->assertEquals(sprintf('A unique field entity with unique_field_test %s already exists.', $definition['field_test_text'][2]), $violations[1]->getMessage());
 
   }