From: Armin Ronacher Date: Tue, 6 Mar 2007 16:45:28 +0000 (+0100) Subject: [svn] improved exception for trans X-Git-Tag: 2.0rc1~453 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a5f6234970db0d4b443d7730839ed531ca99096a;p=jinja2.git [svn] improved exception for trans --HG-- branch : trunk --- diff --git a/jinja/parser.py b/jinja/parser.py index a257985..064419a 100644 --- a/jinja/parser.py +++ b/jinja/parser.py @@ -311,8 +311,9 @@ class Parser(object): 'variable %r.' % variable_name, lineno) if self.tokenstream.next()[1] != 'variable_end': - raise TemplateSyntaxError('invalid syntax for variable ' - 'expression.', lineno) + raise TemplateSyntaxError('you cannot use variable expressions ' + 'inside trans tags. apply filters ' + 'in the trans header.', lineno) buf.append('%%(%s)s' % variable_name) # nested blocks are not supported, just look for end blocks elif token == 'block_begin':