From 02ddc0a32bce6651f77afb62af8cbe29ffe09b4c Mon Sep 17 00:00:00 2001 From: Amy Frear Date: Tue, 30 Jan 2024 16:13:37 -0500 Subject: [PATCH] revert translation use --- src/EventSubscriber/ViewsAjaxResponseSubscriber.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/EventSubscriber/ViewsAjaxResponseSubscriber.php b/src/EventSubscriber/ViewsAjaxResponseSubscriber.php index 1f21bb3..8389704 100644 --- a/src/EventSubscriber/ViewsAjaxResponseSubscriber.php +++ b/src/EventSubscriber/ViewsAjaxResponseSubscriber.php @@ -4,7 +4,6 @@ use Drupal\Core\Ajax\AnnounceCommand; use Drupal\Core\Ajax\FocusFirstCommand; -use Drupal\Core\StringTranslation\TranslationManager; use Drupal\views\Ajax\ViewAjaxResponse; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\FilterResponseEvent; @@ -58,7 +57,7 @@ public function onResponse(FilterResponseEvent $event) { // Add in Announce for number of results. $result_count = count($view->result); // @todo variablise this in a settings page. - $msg = new translation()->formatPlural($result_count, '1 result loaded.', '@count results loaded.'); + $msg = \Drupal::translation()->formatPlural($result_count, '1 result loaded.', '@count results loaded.'); $response->addCommand(new AnnounceCommand($msg, 'assertive')); // Add in focus command.