[svn] improved exception for trans
authorArmin Ronacher <armin.ronacher@active-4.com>
Tue, 6 Mar 2007 16:45:28 +0000 (17:45 +0100)
committerArmin Ronacher <armin.ronacher@active-4.com>
Tue, 6 Mar 2007 16:45:28 +0000 (17:45 +0100)
--HG--
branch : trunk

jinja/parser.py

index a257985f27606d7868617ef99a0c475a508ae356..064419a5aae6467ce3a521dcbda6bc349a3bff64 100644 (file)
@@ -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':