Skip to content

Commit

Permalink
Merge 4cf0f7b into 1f04a53
Browse files Browse the repository at this point in the history
  • Loading branch information
jaroslavlibal committed Jan 18, 2021
2 parents 1f04a53 + 4cf0f7b commit d321c9c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Latte/TranslateMacros.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

use Kdyby\Translation\PrefixedTranslator;
use Latte\Compiler;
use Latte\Engine;
use Latte\MacroNode;
use Latte\PhpWriter;

Expand Down Expand Up @@ -48,7 +49,15 @@ public function macroTranslate(MacroNode $node, PhpWriter $writer)
$value = 'ob_get_clean()';
}

return $writer->write('$_fi = new LR\FilterInfo(%var); echo %modifyContent($this->filters->filterContent("translate", $_fi, %raw))', $node->context[0], $value);
if (!defined(Engine::class . '::VERSION_ID') || Engine::VERSION_ID < 20804) {
return $writer->write('$_fi = new LR\FilterInfo(%var); echo %modifyContent($this->filters->filterContent("translate", $_fi, %raw))', $node->context[0], $value);
}

if (Engine::VERSION_ID >= 20900 && Engine::VERSION_ID < 20902) {
return $writer->write('$__fi = new LR\FilterInfo(%var); echo %modifyContent($this->filters->filterContent("translate", $__fi, %raw))', $node->context[0], $value);
}

return $writer->write('$ʟ_fi = new LR\FilterInfo(%var); echo %modifyContent($this->filters->filterContent("translate", $ʟ_fi, %raw))', $node->context[0], $value);

} elseif ($node->args !== '') {
$node->empty = TRUE;
Expand Down

0 comments on commit d321c9c

Please sign in to comment.