diff --git a/plugins/TreeNotes/templates/tree_notes/note_replies_block.html.twig b/plugins/TreeNotes/templates/tree_notes/note_replies_block.html.twig index 740b0b69f0..202a667bd4 100644 --- a/plugins/TreeNotes/templates/tree_notes/note_replies_block.html.twig +++ b/plugins/TreeNotes/templates/tree_notes/note_replies_block.html.twig @@ -9,10 +9,10 @@ {% endfor %} {% if conversation.show_more %} - {{ transchoice({ + {{ trans({ '1': 'Show an additional reply', 'other': 'Show # additional replies' - }, (conversation.total_replies - config('plugin_tree_notes', 'feed_replies'))) }} + }, {'count': (conversation.total_replies - config('plugin_tree_notes', 'feed_replies'))}) }} {% endif %} diff --git a/src/Twig/Extension.php b/src/Twig/Extension.php index 1907a9111f..8562d39deb 100644 --- a/src/Twig/Extension.php +++ b/src/Twig/Extension.php @@ -79,7 +79,7 @@ class Extension extends AbstractExtension new TwigFunction('open_details', [Runtime::class, 'openDetails']), new TwigFunction('show_stylesheets', [Runtime::class, 'getShowStylesheets']), new TwigFunction('add_right_panel_block', [Runtime::class, 'addRightPanelBlock']), - new TwigFunction('transchoice', [Runtime::class, 'transchoice']), + new TwigFunction('trans', [Runtime::class, 'trans']), ]; } } diff --git a/src/Twig/Runtime.php b/src/Twig/Runtime.php index 4e6c4e6f51..dc84ec607a 100644 --- a/src/Twig/Runtime.php +++ b/src/Twig/Runtime.php @@ -57,9 +57,9 @@ class Runtime implements RuntimeExtensionInterface, EventSubscriberInterface $this->request = $req; } - public function transchoice(array $message, int $count): string + public function trans(array $message, array $arguments): string { - return _m($message, ['count' => $count]); + return _m($message, $arguments); } public function isCurrentRouteActive(string ...$routes): string