From 1273640d958ab5e0caff813bf8baec7fc1e026f5 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 7 Oct 2024 01:38:32 +0200 Subject: [PATCH] TranslatorExtension: translate() can return \Stringable [Closes #372] --- src/Latte/Essential/TranslatorExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Latte/Essential/TranslatorExtension.php b/src/Latte/Essential/TranslatorExtension.php index f5d202f70..738991881 100644 --- a/src/Latte/Essential/TranslatorExtension.php +++ b/src/Latte/Essential/TranslatorExtension.php @@ -50,7 +50,7 @@ public function getTags(): array public function getFilters(): array { return [ - 'translate' => fn(Latte\Runtime\FilterInfo $fi, ...$args): string => $this->translator + 'translate' => fn(Latte\Runtime\FilterInfo $fi, ...$args) => $this->translator ? ($this->translator)(...$args) : $args[0], ];