diff -r 81d089f1a551 django/bin/make-messages.py
--- a/django/bin/make-messages.py	Sat Jun 21 17:58:47 2008 -0300
+++ b/django/bin/make-messages.py	Mon Jun 23 22:32:33 2008 -0300
@@ -5,7 +5,7 @@
 import optparse
 
 from django.core.management.base import CommandError
-from django.core.management.commands.makemessages import make_messages
+from django.core.management.commands.makemessages import make_messages, handle_extensions
 from django.core.management.color import color_style
 
 def main():
@@ -18,9 +18,13 @@
     parser.add_option('-v', '--verbose', action='store_true', dest='verbose',
         default=False, help='Verbosity output')
     parser.add_option('-a', '--all', action='store_true', dest='all',
-        default=False, help='Reexamines all source code and templates for \
-            new translation strings and updates all message files for all \
-            available languages.')
+        default=False, help='Reexamines all source code and templates for '
+            'new translation strings and updates all message files for all '
+            'available languages.')
+    parser.add_option('-e', '--extension', action='append', dest='extensions',
+        help='The file extension(s) to examine (default: ".html", '
+            'separate multiple extensions with commas, or use -e multiple '
+            'times).')
 
     options, args = parser.parse_args()
     if len(args):
@@ -29,10 +33,13 @@
         verbosity = 2
     else:
         verbosity = 1
-    
+    if options.extensions is None:
+        options.extensions = []
+
+    extensions = handle_extensions(options.extensions)
     try:
         make_messages(locale=options.locale, domain=options.domain,
-            verbosity=verbosity, all=options.all)
+            verbosity=verbosity, all=options.all, extensions=extensions)
     except CommandError, e:
         style = color_style()
         sys.stderr.write(style.ERROR(str('Error: %s\n' % e)))
diff -r 81d089f1a551 django/core/management/commands/makemessages.py
--- a/django/core/management/commands/makemessages.py	Sat Jun 21 17:58:47 2008 -0300
+++ b/django/core/management/commands/makemessages.py	Mon Jun 23 22:32:33 2008 -0300
@@ -5,17 +5,48 @@
 from optparse import make_option
 from django.core.management.base import CommandError, BaseCommand
 
+try:
+    set
+except NameError:
+    from sets import Set as set     # For Python 2.3
+
 pythonize_re = re.compile(r'\n\s*//')
 
-def make_messages(locale=None, domain='django', verbosity='1', all=False):
+def handle_extensions(extensions, default='.html'):
+    """
+    organizes multiple extensions that are separated with commas or passed by
+    using --extension/-e multiple times.
+
+    for example: running 'django-admin makemessages -e js,txt -e xhtml -a'
+    would result in a extension list: ['.js', '.txt', '.xhtml']
+
+    >>> handle_extensions(['.html', 'html,js,py,py,py,.py', 'py,.py'])
+    ['.html', '.js']
+    """
+    ext_list = []
+    for ext in extensions:
+        ext_list += ext.lower().split(',')
+    for i, ext in enumerate(ext_list):
+        if not ext.startswith('.'):
+            ext_list[i] = '.%s' % ext_list[i]
+
+    # we don't want *.py files here because of the way non-*.py files
+    # are handled in make_messages() (they are copied to file.ext.py files to
+    # trick xgettext to parse them as python files)
+    extensions = list(set([x for x in ext_list if not x == ('.py')]))
+    if not extensions:
+        return [default]
+    return extensions
+
+def make_messages(locale=None, domain='django', verbosity='1', all=False, extensions=None):
     """
     Uses the locale directory from the Django SVN tree or an application/
-    project to process all 
+    project to process all
     """
     # Need to ensure that the i18n framework is enabled
     from django.conf import settings
     settings.configure(USE_I18N = True)
-    
+
     from django.utils.translation import templatize
 
     if os.path.isdir(os.path.join('conf', 'locale')):
@@ -24,7 +55,7 @@
         localedir = os.path.abspath('locale')
     else:
         raise CommandError("This script should be run from the Django SVN tree or your project or app tree. If you did indeed run it from the SVN checkout or your project or application, maybe you are just missing the conf/locale (in the django tree) or locale (for project and application) directory? It is not created automatically, you have to create it by hand if you want to enable i18n for your project or application.")
-    
+
     if domain not in ('django', 'djangojs'):
         raise CommandError("currently makemessages only supports domains 'django' and 'djangojs'")
 
@@ -35,6 +66,9 @@
         else:
             message = "usage: make-messages.py -l <language>\n   or: make-messages.py -a\n"
         raise CommandError(message)
+
+    if not extensions:
+        extensions = ['.html']
 
     languages = []
     if locale is not None:
@@ -60,7 +94,8 @@
             all_files.extend([(dirpath, f) for f in filenames])
         all_files.sort()
         for dirpath, file in all_files:
-            if domain == 'djangojs' and file.endswith('.js'):
+            file_base, file_ext = os.path.splitext(file)
+            if domain == 'djangojs' and file_ext == '.js':
                 if verbosity > 1:
                     sys.stdout.write('processing file %s in %s\n' % (file, dirpath))
                 src = open(os.path.join(dirpath, file), "rb").read()
@@ -84,9 +119,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 extensions):
                 thefile = file
-                if file.endswith('.html'):
+                if file_ext in extensions:
                     src = open(os.path.join(dirpath, file), "rb").read()
                     thefile = '%s.py' % file
                     open(os.path.join(dirpath, thefile), "wb").write(templatize(src))
@@ -141,6 +176,9 @@
             help='Verbosity level; 0=minimal output, 1=normal output, 2=all output'),
         make_option('--all', '-a', action='store_true', dest='all',
             default=False, help='Reexamines all source code and templates for new translation strings and updates all message files for all available languages.'),
+        make_option('--extension', '-e', default=None, dest='extensions',
+            help='The file extension(s) to examine (default: ".html", separate multiple extensions with commas, or use -e multiple times)',
+            action='append'),
     )
     help = "Runs over the entire source tree of the current directory and pulls out all strings marked for translation. It creates (or updates) a message file in the conf/locale (in the django tree) or locale (for project and application) directory."
 
@@ -155,5 +193,7 @@
         domain = options.get('domain')
         verbosity = int(options.get('verbosity'))
         process_all = options.get('all')
+        extensions = options.get('extensions') or []
 
-        make_messages(locale, domain, verbosity, process_all)
+        extensions = handle_extensions(extensions)
+        make_messages(locale, domain, verbosity, process_all, extensions)
diff -r 81d089f1a551 docs/django-admin.txt
--- a/docs/django-admin.txt	Sat Jun 21 17:58:47 2008 -0300
+++ b/docs/django-admin.txt	Mon Jun 23 22:32:33 2008 -0300
@@ -411,6 +411,20 @@
 Example usage::
 
     django-admin.py makemessages --all
+
+--extension
+~~~~~~~~~~~
+
+Use the ``--extension`` or ``-e`` option to specify a list of file extensions
+to examine (default: ".html").
+
+Example usage::
+
+    django-admin.py makemessages --locale=de --extension xhtml
+
+Separate multiple extensions with commas or use -e/--extension multiple times::
+
+    django-admin.py makemessages --locale=de --extension=tpl,xml --extension=txt
 
 --locale
 ~~~~~~~~
diff -r 81d089f1a551 docs/man/django-admin.1
--- a/docs/man/django-admin.1	Sat Jun 21 17:58:47 2008 -0300
+++ b/docs/man/django-admin.1	Mon Jun 23 22:32:33 2008 -0300
@@ -49,7 +49,7 @@
 .B sqlall
 for the given app(s) in the current database.
 .TP
-.BI "makemessages [" "\-\-locale=LOCALE" "] [" "\-\-domain=DOMAIN" "] [" "\-\-all" "]"
+.BI "makemessages [" "\-\-locale=LOCALE" "] [" "\-\-domain=DOMAIN" "] [" "\-\-extension=EXTENSION" "] [" "\-\-all" "]"
 Runs over the entire source tree of the current directory and pulls out all
 strings marked for translation. It creates (or updates) a message file in the
 conf/locale (in the django tree) or locale (for project and application) directory.
@@ -154,6 +154,10 @@
 .I \-d, \-\-domain=DOMAIN
 The domain of the message files (default: "django") when using makemessages.
 .TP
+.I \-e, \-\-extension=EXTENSION
+The file extension(s) to examine (default: ".html", separate multiple
+extensions with commas, or use -e multiple times).
+.TP
 .I \-a, \-\-all
 Process all available locales when using makemessages.
 .SH "ENVIRONMENT"
