Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed trans tag

  • Loading branch information...
commit 560990d47ba3fefea18420f9951b54d490715b19 1 parent 3076c97
@fabpot authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/Twig/Extensions/Node/Trans.php
View
7 lib/Twig/Extensions/Node/Trans.php
@@ -100,16 +100,19 @@ public function compile(Twig_Compiler $compiler)
protected function compileString(Twig_NodeInterface $body)
{
- if ($body instanceof Twig_Node_Expression_Name || $body instanceof Twig_Node_Expression_Constant) {
+ if ($body instanceof Twig_Node_Expression_Name || $body instanceof Twig_Node_Expression_Constant || $body instanceof Twig_Node_Expression_TempName) {
return array($body, array());
}
$vars = array();
-
if (count($body)) {
$msg = '';
foreach ($body as $node) {
+ if (get_class($node) === 'Twig_Node' && $node->getNode(0) instanceof Twig_Node_SetTemp) {
+ $node = $node->getNode(1);
+ }
+
if ($node instanceof Twig_Node_Print) {
$n = $node->getNode('expr');
while ($n instanceof Twig_Node_Expression_Filter) {
Please sign in to comment.
Something went wrong with that request. Please try again.