diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
--- a/django/core/management/commands/makemessages.py
+++ b/django/core/management/commands/makemessages.py
@@ -128,14 +128,11 @@
                 os.unlink(os.path.join(dirpath, thefile))
             elif domain == 'django' and (file_ext == '.py' or file_ext in extensions):
                 thefile = file
+                orig_file = os.path.join(dirpath, file)
                 if file_ext in extensions:
-                    src = open(os.path.join(dirpath, file), "rU").read()
+                    src = open(orig_file, "rU").read()
                     thefile = '%s.py' % file
-                    try:
-                        open(os.path.join(dirpath, thefile), "w").write(templatize(src))
-                    except SyntaxError, msg:
-                        msg = "%s (file: %s)" % (msg, os.path.join(dirpath, file))
-                        raise SyntaxError(msg)
+                    open(os.path.join(dirpath, thefile), "w").write(templatize(src, orig_file[2:]))
                 if verbosity > 1:
                     sys.stdout.write('processing file %s in %s\n' % (file, dirpath))
                 cmd = 'xgettext -d %s -L Python --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --keyword=ugettext_noop --keyword=ugettext_lazy --keyword=ungettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % (
@@ -148,7 +145,7 @@
 
                 if thefile != file:
                     old = '#: '+os.path.join(dirpath, thefile)[2:]
-                    new = '#: '+os.path.join(dirpath, file)[2:]
+                    new = '#: '+orig_file[2:]
                     msgs = msgs.replace(old, new)
                 if os.path.exists(potfile):
                     # Strip the header
diff --git a/django/template/__init__.py b/django/template/__init__.py
--- a/django/template/__init__.py
+++ b/django/template/__init__.py
@@ -193,7 +193,11 @@
     else:
         lexer_class, parser_class = Lexer, Parser
     lexer = lexer_class(template_string, origin)
-    parser = parser_class(lexer.tokenize())
+    tokens = lexer.tokenize()
+    tokens = zip(*tokens)
+    if tokens:
+        tokens = tokens[0]
+    parser = parser_class(list(tokens))
     return parser.parse()
 
 class Token(object):
@@ -225,6 +229,7 @@
     def __init__(self, template_string, origin):
         self.template_string = template_string
         self.origin = origin
+        self.lineno = 1
 
     def tokenize(self):
         "Return a list of tokens from a given template_string."
@@ -232,7 +237,7 @@
         result = []
         for bit in tag_re.split(self.template_string):
             if bit:
-                result.append(self.create_token(bit, in_tag))
+                result.append((self.create_token(bit, in_tag), self.lineno))
             in_tag = not in_tag
         return result
 
@@ -251,6 +256,7 @@
                 token = Token(TOKEN_COMMENT, '')
         else:
             token = Token(TOKEN_TEXT, token_string)
+        self.lineno += token_string.count('\n')
         return token
 
 class Parser(object):
diff --git a/django/template/debug.py b/django/template/debug.py
--- a/django/template/debug.py
+++ b/django/template/debug.py
@@ -14,13 +14,13 @@
         for match in tag_re.finditer(self.template_string):
             start, end = match.span()
             if start > upto:
-                result.append(self.create_token(self.template_string[upto:start], (upto, start), False))
+                result.append((self.create_token(self.template_string[upto:start], (upto, start), False), None))
                 upto = start
-            result.append(self.create_token(self.template_string[start:end], (start, end), True))
+            result.append((self.create_token(self.template_string[start:end], (start, end), True), None))
             upto = end
         last_bit = self.template_string[upto:]
         if last_bit:
-            result.append(self.create_token(last_bit, (upto, upto + len(last_bit)), False))
+            result.append((self.create_token(last_bit, (upto, upto + len(last_bit)), False), None))
         return result
 
     def create_token(self, token_string, source, in_tag):
diff --git a/django/utils/translation/__init__.py b/django/utils/translation/__init__.py
--- a/django/utils/translation/__init__.py
+++ b/django/utils/translation/__init__.py
@@ -96,8 +96,8 @@
 def get_language_from_request(request):
     return real_get_language_from_request(request)
 
-def templatize(src):
-    return real_templatize(src)
+def templatize(src, origin=None):
+    return real_templatize(src, origin)
 
 def deactivate_all():
     return real_deactivate_all()
diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py
--- a/django/utils/translation/trans_real.py
+++ b/django/utils/translation/trans_real.py
@@ -244,7 +244,7 @@
     True = right-to-left layout
     """
     from django.conf import settings
-    
+
     base_lang = get_language().split('-')[0]
     return base_lang in settings.LANGUAGES_BIDI
 
@@ -408,7 +408,7 @@
 plural_re = re.compile(r"""^\s*plural$""")
 constant_re = re.compile(r"""_\(((?:".*?")|(?:'.*?'))\)""")
 
-def templatize(src):
+def templatize(src, origin=None):
     """
     Turns a Django template into something that is understood by xgettext. It
     does so by translating the Django translation tags into standard gettext
@@ -420,7 +420,7 @@
     inplural = False
     singular = []
     plural = []
-    for t in Lexer(src, None).tokenize():
+    for t, lineno in Lexer(src, origin).tokenize():
         if intrans:
             if t.token_type == TOKEN_BLOCK:
                 endbmatch = endblock_re.match(t.contents)
@@ -443,7 +443,7 @@
                 elif pluralmatch:
                     inplural = True
                 else:
-                    raise SyntaxError("Translation blocks must not include other block tags: %s" % t.contents)
+                    raise SyntaxError("Translation blocks must not include other block tags: %s (file %s, line %d)" % (t.contents, origin, lineno))
             elif t.token_type == TOKEN_VAR:
                 if inplural:
                     plural.append('%%(%s)s' % t.contents)
