Skip to content

Commit

Permalink
revert translation use
Browse files Browse the repository at this point in the history
  • Loading branch information
a-frear committed Jan 30, 2024
1 parent 8c7e8ba commit 02ddc0a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/EventSubscriber/ViewsAjaxResponseSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 02ddc0a

Please sign in to comment.