diff --git a/core/modules/config/tests/config_override_integration_test/src/Cache/ConfigOverrideIntegrationTestCacheContext.php b/core/modules/config/tests/config_override_integration_test/src/Cache/ConfigOverrideIntegrationTestCacheContext.php index de9fefcc4a..411a7a0dec 100644 --- a/core/modules/config/tests/config_override_integration_test/src/Cache/ConfigOverrideIntegrationTestCacheContext.php +++ b/core/modules/config/tests/config_override_integration_test/src/Cache/ConfigOverrideIntegrationTestCacheContext.php @@ -4,6 +4,7 @@ use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Cache\Context\CacheContextInterface; +use Drupal\Core\StringTranslation\TranslatableMarkup; /** * A cache context service intended for the config override integration test. @@ -16,7 +17,7 @@ class ConfigOverrideIntegrationTestCacheContext implements CacheContextInterface * {@inheritdoc} */ public static function getLabel() { - return t('Config override integration test'); + return new TranslatableMarkup('Config override integration test'); } /** diff --git a/core/modules/config/tests/config_override_test/src/Cache/PirateDayCacheContext.php b/core/modules/config/tests/config_override_test/src/Cache/PirateDayCacheContext.php index b9e2490f37..67a12c32c9 100644 --- a/core/modules/config/tests/config_override_test/src/Cache/PirateDayCacheContext.php +++ b/core/modules/config/tests/config_override_test/src/Cache/PirateDayCacheContext.php @@ -4,6 +4,7 @@ use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Cache\Context\CacheContextInterface; +use Drupal\Core\StringTranslation\TranslatableMarkup; /** * Defines the PirateDayCacheContext service that allows to cache the booty. @@ -27,7 +28,7 @@ class PirateDayCacheContext implements CacheContextInterface { * {@inheritdoc} */ public static function getLabel() { - return t('Pirate day'); + return new TranslatableMarkup('Pirate day'); } /** diff --git a/core/modules/config/tests/config_test/src/ConfigTestForm.php b/core/modules/config/tests/config_test/src/ConfigTestForm.php index 49cc195832..a01b6d400f 100644 --- a/core/modules/config/tests/config_test/src/ConfigTestForm.php +++ b/core/modules/config/tests/config_test/src/ConfigTestForm.php @@ -23,7 +23,7 @@ public function form(array $form, FormStateInterface $form_state) { $entity = $this->entity; $form['label'] = [ '#type' => 'textfield', - '#title' => 'Label', + '#title' => $this->t('Label'), '#default_value' => $entity->label(), '#required' => TRUE, ]; @@ -38,12 +38,12 @@ public function form(array $form, FormStateInterface $form_state) { ]; $form['weight'] = [ '#type' => 'weight', - '#title' => 'Weight', + '#title' => $this->t('Weight'), '#default_value' => $entity->get('weight'), ]; $form['style'] = [ '#type' => 'select', - '#title' => 'Image style', + '#title' => $this->t('Image style'), '#options' => [], '#default_value' => $entity->get('style'), '#access' => FALSE, @@ -66,11 +66,11 @@ public function form(array $form, FormStateInterface $form_state) { ]; $form['size_wrapper']['size'] = [ '#type' => 'select', - '#title' => 'Size', + '#title' => $this->t('Size'), '#options' => [ 'custom' => 'Custom', ], - '#empty_option' => '- None -', + '#empty_option' => $this->t('- None -'), '#default_value' => $size, '#ajax' => [ 'callback' => '::updateSize', @@ -79,7 +79,7 @@ public function form(array $form, FormStateInterface $form_state) { ]; $form['size_wrapper']['size_submit'] = [ '#type' => 'submit', - '#value' => t('Change size'), + '#value' => $this->t('Change size'), '#attributes' => [ 'class' => ['js-hide'], ], @@ -87,7 +87,7 @@ public function form(array $form, FormStateInterface $form_state) { ]; $form['size_wrapper']['size_value'] = [ '#type' => 'select', - '#title' => 'Custom size value', + '#title' => $this->t('Custom size value'), '#options' => [ 'small' => 'Small', 'medium' => 'Medium', @@ -99,7 +99,7 @@ public function form(array $form, FormStateInterface $form_state) { $form['langcode'] = [ '#type' => 'language_select', - '#title' => t('Language'), + '#title' => $this->t('Language'), '#languages' => LanguageInterface::STATE_ALL, '#default_value' => $entity->language()->getId(), ]; @@ -107,11 +107,11 @@ public function form(array $form, FormStateInterface $form_state) { $form['actions'] = ['#type' => 'actions']; $form['actions']['submit'] = [ '#type' => 'submit', - '#value' => 'Save', + '#value' => $this->t('Save'), ]; $form['actions']['delete'] = [ '#type' => 'submit', - '#value' => 'Delete', + '#value' => $this->t('Delete'), ]; return $form; diff --git a/core/modules/config/tests/config_test/src/ConfigTestListBuilder.php b/core/modules/config/tests/config_test/src/ConfigTestListBuilder.php index e94a68b71f..8fbfca03c8 100644 --- a/core/modules/config/tests/config_test/src/ConfigTestListBuilder.php +++ b/core/modules/config/tests/config_test/src/ConfigTestListBuilder.php @@ -16,8 +16,8 @@ class ConfigTestListBuilder extends ConfigEntityListBuilder { * {@inheritdoc} */ public function buildHeader() { - $header['label'] = t('Label'); - $header['id'] = t('Machine name'); + $header['label'] = $this->t('Label'); + $header['id'] = $this->t('Machine name'); return $header + parent::buildHeader(); }