Provide a clearer error message when message in trans tag is not a simple text.

This commit is contained in:
Pablo Godel 2012-05-09 10:13:29 -03:00
parent e54f4e46c9
commit 190024aeeb

View File

@ -62,7 +62,7 @@ class TransTokenParser extends \Twig_TokenParser
$body = $this->parser->subparse(array($this, 'decideTransFork'), true);
if (!$body instanceof \Twig_Node_Text && !$body instanceof \Twig_Node_Expression) {
throw new \Twig_Error_Syntax('A message must be a simple text');
throw new \Twig_Error_Syntax('A message inside a trans tag must be a simple text');
}
$stream->expect(\Twig_Token::BLOCK_END_TYPE);