Permalink
Browse files

Template: fixed setTranslator(null) [Closes #204]

  • Loading branch information...
dg committed Nov 26, 2018
1 parent b8238e7 commit fc63a718a8833b905cd2a73c2e9af2af6f512914
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Bridges/ApplicationLatte/Template.php
@@ -97,8 +97,8 @@ public function addFilter(?string $name, callable $callback)
*/
public function setTranslator(?Nette\Localization\ITranslator $translator)
{
$this->latte->addFilter('translate', $translator === null ? null : function (Latte\Runtime\FilterInfo $fi, ...$args) use ($translator): string {
return $translator->translate(...$args);
$this->latte->addFilter('translate', function (Latte\Runtime\FilterInfo $fi, ...$args) use ($translator): string {
return $translator === null ? $args[0] : $translator->translate(...$args);
});
return $this;
}

0 comments on commit fc63a71

Please sign in to comment.