Index: trunk/django/bin/make-messages.py
===================================================================
--- trunk/django/bin/make-messages.py	(revision 6370)
+++ trunk/django/bin/make-messages.py	(working copy)
@@ -11,9 +11,12 @@
 import getopt
 from itertools import dropwhile
 
+TEMPLATE_EXTENSIONS = ('.html', '.tpl', '.xml', '.txt')
+
 pythonize_re = re.compile(r'\n\s*//')
 
 def make_messages():
+    global TEMPLATE_EXTENSIONS
     localedir = None
 
     if os.path.isdir(os.path.join('conf', 'locale')):
@@ -29,7 +32,7 @@
         print "you want to enable i18n for your project or application."
         sys.exit(1)
 
-    (opts, args) = getopt.getopt(sys.argv[1:], 'l:d:va')
+    (opts, args) = getopt.getopt(sys.argv[1:], 'l:d:vae')
 
     lang = None
     domain = 'django'
@@ -45,7 +48,9 @@
             verbose = True
         elif o == '-a':
             all = True
-
+        elif o == '-e':
+            TEMPLATE_EXTENSIONS = args
+    
     if domain not in ('django', 'djangojs'):
         print "currently make-messages.py only supports domains 'django' and 'djangojs'"
         sys.exit(1)
@@ -62,7 +67,6 @@
         languages = [el for el in os.listdir(localedir) if not el.startswith('.')]
 
     for lang in languages:
-
         print "processing language", lang
         basedir = os.path.join(localedir, lang, 'LC_MESSAGES')
         if not os.path.isdir(basedir):
@@ -76,7 +80,8 @@
 
         for (dirpath, dirnames, filenames) in os.walk("."):
             for file in filenames:
-                if domain == 'djangojs' and file.endswith('.js'):
+                file_base, file_ext = os.path.splitext(file)
+                if domain == 'djangojs' and file_ext == 'js':
                     if verbose: sys.stdout.write('processing file %s in %s\n' % (file, dirpath))
                     src = open(os.path.join(dirpath, file), "rb").read()
                     src = pythonize_re.sub('\n#', src)
@@ -97,9 +102,9 @@
                     if msgs:
                         open(potfile, 'ab').write(msgs)
                     os.unlink(os.path.join(dirpath, thefile))
-                elif domain == 'django' and (file.endswith('.py') or file.endswith('.html')):
+                elif domain == 'django' and (file_ext == 'py' or file_ext in TEMPLATE_EXTENSIONS):
                     thefile = file
-                    if file.endswith('.html'):
+                    if file_ext in TEMPLATE_EXTENSIONS:
                         src = open(os.path.join(dirpath, file), "rb").read()
                         thefile = '%s.py' % file
                         open(os.path.join(dirpath, thefile), "wb").write(templatize(src))
