Skip to content

Commit

Permalink
[TwigBundle] fixed trans tag due to Twig changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jan 3, 2011
1 parent 8ca90d5 commit 8b843e2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/TwigBundle/Node/TransNode.php
Expand Up @@ -108,6 +108,6 @@ protected function compileString(\Twig_NodeInterface $body)
}
}

return array(new \Twig_Node(array(new \Twig_Node_Expression_Constant(trim($msg), $node->getLine()))), $vars);
return array(new \Twig_Node_Expression_Constant(trim($msg), $body->getLine()), $vars);
}
}
Expand Up @@ -53,6 +53,9 @@ public function parse(\Twig_Token $token)
$stream->expect(\Twig_Token::BLOCK_END_TYPE);

$body = $this->parser->subparse(array($this, 'decideTransChoiceFork'), true);
if ('Twig_Node' !== get_class($body)) {
$body = new \Twig_Node(array($body), array(), $body->getLine());
}

$stream->expect(\Twig_Token::BLOCK_END_TYPE);

Expand Down
Expand Up @@ -62,6 +62,9 @@ public function parse(\Twig_Token $token)
// {% trans %}message{% endtrans %}
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
$body = $this->parser->subparse(array($this, 'decideTransFork'), true);
if ('Twig_Node' !== get_class($body)) {
$body = new \Twig_Node(array($body), array(), $body->getLine());
}
$isSimple = $this->isSimpleString($body);
}

Expand Down

0 comments on commit 8b843e2

Please sign in to comment.