Index: django/core/management/commands/messagesunique.py
===================================================================
--- django/core/management/commands/messagesunique.py	(Revision 0)
+++ django/core/management/commands/messagesunique.py	(Revision 0)
@@ -0,0 +1,23 @@
+import os
+import sys
+from django.core.management.base import BaseCommand, CommandError, get_locale_dir
+
+class Command(BaseCommand):
+    help = "Unifies recursively duplicate translations of the same message ID."
+
+    requires_model_validation = False
+    can_import_settings = False
+
+    def handle(self, *args, **options):
+        if len(args) != 0:
+            raise CommandError("Command doesn't accept any arguments")
+        basedir = get_locale_dir()
+        for (dirpath, dirnames, filenames) in os.walk(basedir):
+            for f in filenames:
+                if f.endswith('.po'):
+                    sys.stderr.write('processing file %s in %s\n' % (f, dirpath))
+                    pf = os.path.splitext(os.path.join(dirpath, f))[0]
+                    cmd = 'msguniq "%s.po"' % pf
+                    stdout = os.popen(cmd)
+                    msg = stdout.read()
+                    open('%s.po' % pf, 'w').write(msg)
Index: django/core/management/commands/messagesmake.py
===================================================================
--- django/core/management/commands/messagesmake.py	(Revision 0)
+++ django/core/management/commands/messagesmake.py	(Revision 0)
@@ -0,0 +1,146 @@
+import re
+import os
+import sys
+from itertools import dropwhile
+from optparse import make_option
+from django.core.management.base import CommandError, BaseCommand, get_locale_dir
+from django.utils.translation import templatize
+
+# Need to ensure that the i18n framework is enabled
+from django.conf import settings
+settings.configure(USE_I18N = True)
+
+pythonize_re = re.compile(r'\n\s*//')
+
+class Command(BaseCommand):
+    option_list = BaseCommand.option_list + (
+        make_option('-l', '--locale', default=None, dest='locale',
+            help='Creates or updates the message files only for the given locale (e.g. pt_BR).'),
+        make_option('-d', '--domain', default='django', dest='domain',
+            help='The domain of the message files (default: "django").'),
+        make_option('-v', '--verbosity', action='store', dest='verbosity', default='1',
+            type='choice', choices=['0', '1', '2'],
+            help='Verbosity level; 0=minimal output, 1=normal output, 2=all output'),
+        make_option('-a', '--all', action='store_false', dest='all', default=False,
+            help='Reexamines all source code and templates for new translation strings and updates all message files for all available languages.'),
+    )
+    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."
+
+    requires_model_validation = False
+    can_import_settings = False
+
+    def handle(self, *args, **options):
+        if len(args) != 0:
+            raise CommandError("Command doesn't accept any arguments")
+
+        localedir = get_locale_dir()
+        locale = options.get('locale', None)
+        domain = options.get('domain', 'django')
+        verbosity = int(options.get('verbosity', 1))
+        all = options.get('all', False)
+
+        if domain not in ('django', 'djangojs'):
+            raise CommandError("currently messagesmake only supports domains 'django' and 'djangojs'")
+        if (locale is None and not all) or domain is None:
+            # backwards compatible error message
+            if not sys.argv[0].endswith("make-messages.py"):
+                message = "Type '%s help %s' for usage.\n" % (os.path.basename(sys.argv[0]), sys.argv[1])
+            else:
+                message = "usage: make-messages.py -l <language>\n   or: make-messages.py -a\n"
+            sys.stderr.write(message)
+            sys.exit(1)
+
+        languages = []
+
+        if locale is not None:
+            languages.append(locale)
+        elif all:
+            languages = [el for el in os.listdir(localedir) if not el.startswith('.')]
+
+        for locale in languages:
+            if verbosity > 0:
+                print "processing language", locale
+            basedir = os.path.join(localedir, locale, 'LC_MESSAGES')
+            if not os.path.isdir(basedir):
+                os.makedirs(basedir)
+
+            pofile = os.path.join(basedir, '%s.po' % domain)
+            potfile = os.path.join(basedir, '%s.pot' % domain)
+
+            if os.path.exists(potfile):
+                os.unlink(potfile)
+
+            for (dirpath, dirnames, filenames) in os.walk("."):
+                for file in filenames:
+                    if domain == 'djangojs' and file.endswith('.js'):
+                        if verbosity > 1:
+                            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)
+                        open(os.path.join(dirpath, '%s.py' % file), "wb").write(src)
+                        thefile = '%s.py' % file
+                        cmd = 'xgettext %s -d %s -L Perl --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % (
+                            os.path.exists(potfile) and '--omit-header' or '', domain, os.path.join(dirpath, thefile))
+                        (stdin, stdout, stderr) = os.popen3(cmd, 't')
+                        msgs = stdout.read()
+                        errors = stderr.read()
+                        if errors:
+                            print "errors happened while running xgettext on %s" % file
+                            print errors
+                            sys.exit(8)
+                        old = '#: '+os.path.join(dirpath, thefile)[2:]
+                        new = '#: '+os.path.join(dirpath, file)[2:]
+                        msgs = msgs.replace(old, new)
+                        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')):
+                        thefile = file
+                        if file.endswith('.html'):
+                            src = open(os.path.join(dirpath, file), "rb").read()
+                            thefile = '%s.py' % file
+                            open(os.path.join(dirpath, thefile), "wb").write(templatize(src))
+                        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"' % (
+                            domain, os.path.join(dirpath, thefile))
+                        (stdin, stdout, stderr) = os.popen3(cmd, 't')
+                        msgs = stdout.read()
+                        errors = stderr.read()
+                        if errors:
+                            print "errors happened while running xgettext on %s" % file
+                            print errors
+                            sys.exit(8)
+                        if thefile != file:
+                            old = '#: '+os.path.join(dirpath, thefile)[2:]
+                            new = '#: '+os.path.join(dirpath, file)[2:]
+                            msgs = msgs.replace(old, new)
+                        if os.path.exists(potfile):
+                            # Strip the header
+                            msgs = '\n'.join(dropwhile(len, msgs.split('\n')))
+                        else:
+                            msgs = msgs.replace('charset=CHARSET', 'charset=UTF-8')
+                        if msgs:
+                            open(potfile, 'ab').write(msgs)
+                        if thefile != file:
+                            os.unlink(os.path.join(dirpath, thefile))
+
+            if os.path.exists(potfile):
+                (stdin, stdout, stderr) = os.popen3('msguniq --to-code=utf-8 "%s"' % potfile, 'b')
+                msgs = stdout.read()
+                errors = stderr.read()
+                if errors:
+                    print "errors happened while running msguniq"
+                    print errors
+                    sys.exit(8)
+                open(potfile, 'w').write(msgs)
+                if os.path.exists(pofile):
+                    (stdin, stdout, stderr) = os.popen3('msgmerge -q "%s" "%s"' % (pofile, potfile), 'b')
+                    msgs = stdout.read()
+                    errors = stderr.read()
+                    if errors:
+                        print "errors happened while running msgmerge"
+                        print errors
+                        sys.exit(8)
+                open(pofile, 'wb').write(msgs)
+                os.unlink(potfile)
Index: django/core/management/commands/messagescompile.py
===================================================================
--- django/core/management/commands/messagescompile.py	(Revision 0)
+++ django/core/management/commands/messagescompile.py	(Revision 0)
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+import os
+import sys
+from optparse import make_option
+from django.core.management.base import BaseCommand, CommandError, get_locale_dir
+from django.core.management.color import no_style
+
+class Command(BaseCommand):
+    option_list = BaseCommand.option_list + (
+        make_option('-l', '--locale', dest='locale',
+            help='The locale to process. Default is to process all.'),
+    )
+    help = 'Compiles .po files to .mo files for use with builtin gettext support.'
+
+    requires_model_validation = False
+    can_import_settings = False
+
+    def handle(self, **options):
+        basedir = get_locale_dir()
+        locale = options.get('locale', None)
+        if locale is not None:
+            basedir = os.path.join(basedir, locale, 'LC_MESSAGES')
+
+        for dirpath, dirnames, filenames in os.walk(basedir):
+            for f in filenames:
+                if f.endswith('.po'):
+                    sys.stderr.write('processing file %s in %s\n' % (f, dirpath))
+                    pf = os.path.splitext(os.path.join(dirpath, f))[0]
+                    # Store the names of the .mo and .po files in an environment
+                    # variable, rather than doing a string replacement into the
+                    # command, so that we can take advantage of shell quoting, to
+                    # quote any malicious characters/escaping.
+                    # See http://cyberelk.net/tim/articles/cmdline/ar01s02.html
+                    os.environ['djangocompilemo'] = pf + '.mo'
+                    os.environ['djangocompilepo'] = pf + '.po'
+                    if sys.platform == 'win32': # Different shell-variable syntax
+                        cmd = 'msgfmt --check-format -o "%djangocompilemo%" "%djangocompilepo%"'
+                    else:
+                        cmd = 'msgfmt --check-format -o "$djangocompilemo" "$djangocompilepo"'
+                    os.system(cmd)
Index: django/core/management/commands/cleanup.py
===================================================================
--- django/core/management/commands/cleanup.py	(Revision 0)
+++ django/core/management/commands/cleanup.py	(Revision 0)
@@ -0,0 +1,11 @@
+import datetime
+from django.core.management.base import NoArgsCommand
+
+class Command(NoArgsCommand):
+    help = "Can be run as a cronjob or directly to clean out old data from the database (only expired sessions at the moment)."
+
+    def handle_noargs(self, **options):
+        from django.db import transaction
+        from django.contrib.sessions.models import Session
+        Session.objects.filter(expire_date__lt=datetime.datetime.now()).delete()
+        transaction.commit_unless_managed()
Index: django/core/management/base.py
===================================================================
--- django/core/management/base.py	(Revision 6193)
+++ django/core/management/base.py	(Arbeitskopie)
@@ -203,6 +203,16 @@
             except OSError:
                 sys.stderr.write(style.NOTICE("Notice: Couldn't set permission bits on %s. You're probably using an uncommon filesystem setup. No problem.\n" % path_new))
 
+def get_locale_dir():
+    "Returns the locale directory from the Django SVN tree or an application/project"
+    if os.path.isdir(os.path.join('conf', 'locale')):
+        basedir = os.path.abspath(os.path.join('conf', 'locale'))
+    elif os.path.isdir('locale'):
+        basedir = 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.")
+    return basedir
+
 def _make_writeable(filename):
     "Makes sure that the file is writeable. Useful if our source is read-only."
     import stat
Index: django/bin/daily_cleanup.py
===================================================================
--- django/bin/daily_cleanup.py	(Revision 6193)
+++ django/bin/daily_cleanup.py	(Arbeitskopie)
@@ -7,14 +7,7 @@
 sessions at the moment).
 """
 
-import datetime
-from django.db import transaction
-from django.contrib.sessions.models import Session
+from django.core import management
 
-def clean_up():
-    """Clean up expired sessions."""
-    Session.objects.filter(expire_date__lt=datetime.datetime.now()).delete()
-    transaction.commit_unless_managed()
-
 if __name__ == "__main__":
-    clean_up()
+    management.call_command('cleanup')
Index: django/bin/unique-messages.py
===================================================================
--- django/bin/unique-messages.py	(Revision 6193)
+++ django/bin/unique-messages.py	(Arbeitskopie)
@@ -1,28 +1,5 @@
 #!/usr/bin/env python
+from django.core import management
 
-import os
-import sys
-
-def unique_messages():
-    basedir = None
-
-    if os.path.isdir(os.path.join('conf', 'locale')):
-        basedir = os.path.abspath(os.path.join('conf', 'locale'))
-    elif os.path.isdir('locale'):
-        basedir = os.path.abspath('locale')
-    else:
-        print "this script should be run from the django svn tree or your project or app tree"
-        sys.exit(1)
-
-    for (dirpath, dirnames, filenames) in os.walk(basedir):
-        for f in filenames:
-            if f.endswith('.po'):
-                sys.stderr.write('processing file %s in %s\n' % (f, dirpath))
-                pf = os.path.splitext(os.path.join(dirpath, f))[0]
-                cmd = 'msguniq "%s.po"' % pf
-                stdout = os.popen(cmd)
-                msg = stdout.read()
-                open('%s.po' % pf, 'w').write(msg)
-
 if __name__ == "__main__":
-    unique_messages()
+    management.call_command('messagesunique')
Index: django/bin/compile-messages.py
===================================================================
--- django/bin/compile-messages.py	(Revision 6193)
+++ django/bin/compile-messages.py	(Arbeitskopie)
@@ -1,49 +1,17 @@
 #!/usr/bin/env python
-
-import optparse
 import os
 import sys
+import optparse
+from django.core import management
 
-def compile_messages(locale=None):
-    basedir = None
-
-    if os.path.isdir(os.path.join('conf', 'locale')):
-        basedir = os.path.abspath(os.path.join('conf', 'locale'))
-    elif os.path.isdir('locale'):
-        basedir = os.path.abspath('locale')
-    else:
-        print "This script should be run from the Django SVN tree or your project or app tree."
-        sys.exit(1)
-
-    if locale is not None:
-        basedir = os.path.join(basedir, locale, 'LC_MESSAGES')
-
-    for dirpath, dirnames, filenames in os.walk(basedir):
-        for f in filenames:
-            if f.endswith('.po'):
-                sys.stderr.write('processing file %s in %s\n' % (f, dirpath))
-                pf = os.path.splitext(os.path.join(dirpath, f))[0]
-                # Store the names of the .mo and .po files in an environment
-                # variable, rather than doing a string replacement into the
-                # command, so that we can take advantage of shell quoting, to
-                # quote any malicious characters/escaping.
-                # See http://cyberelk.net/tim/articles/cmdline/ar01s02.html
-                os.environ['djangocompilemo'] = pf + '.mo'
-                os.environ['djangocompilepo'] = pf + '.po'
-                if sys.platform == 'win32': # Different shell-variable syntax
-                    cmd = 'msgfmt --check-format -o "%djangocompilemo%" "%djangocompilepo%"'
-                else:
-                    cmd = 'msgfmt --check-format -o "$djangocompilemo" "$djangocompilepo"'
-                os.system(cmd)
-
 def main():
     parser = optparse.OptionParser()
     parser.add_option('-l', '--locale', dest='locale',
-            help="The locale to process. Default is to process all.")
+        help="The locale to process. Default is to process all.")
     options, args = parser.parse_args()
     if len(args):
         parser.error("This program takes no arguments")
-    compile_messages(options.locale)
+    management.call_command('messagescompile', locale=options.locale)
 
 if __name__ == "__main__":
     main()
Index: django/bin/make-messages.py
===================================================================
--- django/bin/make-messages.py	(Revision 6193)
+++ django/bin/make-messages.py	(Arbeitskopie)
@@ -1,152 +1,31 @@
 #!/usr/bin/env python
-
-# 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
-import re
 import os
 import sys
 import getopt
-from itertools import dropwhile
+import optparse
+from django.core import management
 
-pythonize_re = re.compile(r'\n\s*//')
+def main():
+    parser = optparse.OptionParser()
+    parser.add_option('-l', '--locale', dest='locale',
+        help='Creates or updates the message files only for the given locale (e.g. pt_BR).')
+    parser.add_option('-d', '--domain', dest='domain',
+        help='The domain of the message files (default: "django").')
+    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.')
 
-def make_messages():
-    localedir = None
-
-    if os.path.isdir(os.path.join('conf', 'locale')):
-        localedir = os.path.abspath(os.path.join('conf', 'locale'))
-    elif os.path.isdir('locale'):
-        localedir = os.path.abspath('locale')
+    options, args = parser.parse_args()
+    if len(args):
+        parser.error("This program takes no arguments")
+    if options.verbose:
+        verbosity = 2
     else:
-        print "This script should be run from the django svn tree or your project or app tree."
-        print "If you did indeed run it from the svn checkout or your project or application,"
-        print "maybe you are just missing the conf/locale (in the django tree) or locale (for project"
-        print "and application) directory?"
-        print "make-messages.py doesn't create it automatically, you have to create it by hand if"
-        print "you want to enable i18n for your project or application."
-        sys.exit(1)
+        verbosity = 1
 
-    (opts, args) = getopt.getopt(sys.argv[1:], 'l:d:va')
+    management.call_command('messagesmake', locale=options.locale,
+        domain=options.domain, verbosity=verbosity, all=options.all)
 
-    lang = None
-    domain = 'django'
-    verbose = False
-    all = False
-
-    for o, v in opts:
-        if o == '-l':
-            lang = v
-        elif o == '-d':
-            domain = v
-        elif o == '-v':
-            verbose = True
-        elif o == '-a':
-            all = True
-
-    if domain not in ('django', 'djangojs'):
-        print "currently make-messages.py only supports domains 'django' and 'djangojs'"
-        sys.exit(1)
-    if (lang is None and not all) or domain is None:
-        print "usage: make-messages.py -l <language>"
-        print "   or: make-messages.py -a"
-        sys.exit(1)
-
-    languages = []
-
-    if lang is not None:
-        languages.append(lang)
-    elif all:
-        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):
-            os.makedirs(basedir)
-
-        pofile = os.path.join(basedir, '%s.po' % domain)
-        potfile = os.path.join(basedir, '%s.pot' % domain)
-
-        if os.path.exists(potfile):
-            os.unlink(potfile)
-
-        for (dirpath, dirnames, filenames) in os.walk("."):
-            for file in filenames:
-                if domain == 'djangojs' and file.endswith('.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)
-                    open(os.path.join(dirpath, '%s.py' % file), "wb").write(src)
-                    thefile = '%s.py' % file
-                    cmd = 'xgettext %s -d %s -L Perl --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % (
-                        os.path.exists(potfile) and '--omit-header' or '', domain, os.path.join(dirpath, thefile))
-                    (stdin, stdout, stderr) = os.popen3(cmd, 't')
-                    msgs = stdout.read()
-                    errors = stderr.read()
-                    if errors:
-                        print "errors happened while running xgettext on %s" % file
-                        print errors
-                        sys.exit(8)
-                    old = '#: '+os.path.join(dirpath, thefile)[2:]
-                    new = '#: '+os.path.join(dirpath, file)[2:]
-                    msgs = msgs.replace(old, new)
-                    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')):
-                    thefile = file
-                    if file.endswith('.html'):
-                        src = open(os.path.join(dirpath, file), "rb").read()
-                        thefile = '%s.py' % file
-                        open(os.path.join(dirpath, thefile), "wb").write(templatize(src))
-                    if verbose:
-                        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"' % (
-                        domain, os.path.join(dirpath, thefile))
-                    (stdin, stdout, stderr) = os.popen3(cmd, 't')
-                    msgs = stdout.read()
-                    errors = stderr.read()
-                    if errors:
-                        print "errors happened while running xgettext on %s" % file
-                        print errors
-                        sys.exit(8)
-                    if thefile != file:
-                        old = '#: '+os.path.join(dirpath, thefile)[2:]
-                        new = '#: '+os.path.join(dirpath, file)[2:]
-                        msgs = msgs.replace(old, new)
-                    if os.path.exists(potfile):
-                        # Strip the header
-                        msgs = '\n'.join(dropwhile(len, msgs.split('\n')))
-                    else:
-                        msgs = msgs.replace('charset=CHARSET', 'charset=UTF-8')
-                    if msgs:
-                        open(potfile, 'ab').write(msgs)
-                    if thefile != file:
-                        os.unlink(os.path.join(dirpath, thefile))
-
-        if os.path.exists(potfile):
-            (stdin, stdout, stderr) = os.popen3('msguniq --to-code=utf-8 "%s"' % potfile, 'b')
-            msgs = stdout.read()
-            errors = stderr.read()
-            if errors:
-                print "errors happened while running msguniq"
-                print errors
-                sys.exit(8)
-            open(potfile, 'w').write(msgs)
-            if os.path.exists(pofile):
-                (stdin, stdout, stderr) = os.popen3('msgmerge -q "%s" "%s"' % (pofile, potfile), 'b')
-                msgs = stdout.read()
-                errors = stderr.read()
-                if errors:
-                    print "errors happened while running msgmerge"
-                    print errors
-                    sys.exit(8)
-            open(pofile, 'wb').write(msgs)
-            os.unlink(potfile)
-
 if __name__ == "__main__":
-    make_messages()
+    main()
Index: extras/django_bash_completion
===================================================================
--- extras/django_bash_completion	(Revision 6193)
+++ extras/django_bash_completion	(Arbeitskopie)
@@ -42,13 +42,13 @@
     prev="${COMP_WORDS[COMP_CWORD-1]}"
 
     # Standalone options
-    opts="--help --settings --pythonpath --noinput --noreload --format --indent --verbosity --adminmedia --version"
+    opts="--help --settings --pythonpath --noinput --noreload --locale --all --domain --format --indent --verbosity --adminmedia --version"
     # Actions
-    actions="adminindex createcachetable dbshell diffsettings \
-             dumpdata flush inspectdb loaddata reset runfcgi runserver \
-             shell sql sqlall sqlclear sqlcustom sqlflush sqlindexes \
-             sqlreset sqlsequencereset startapp startproject \
-             syncdb test validate"
+    actions="adminindex createcachetable cleanup dbshell diffsettings \
+             dumpdata flush inspectdb loaddata messagescompile messagesmake \
+             messagesunique reset runfcgi runserver shell sql sqlall \
+             sqlclear sqlcustom sqlflush sqlindexes sqlreset \
+             sqlsequencereset startapp startproject syncdb test validate"
     # Action's options
     action_shell_opts="--plain"
     action_runfcgi_opts="host port socket method maxspare minspare maxchildren daemonize pidfile workdir"
@@ -112,8 +112,9 @@
                 return 0
                 ;;
 
-            createcachetable|dbshell|diffsettings| \
-            inspectdb|runserver|startapp|startproject|syncdb| \
+            createcachetable|cleanup|dbshell|diffsettings| \
+            inspectdb|messagescompile|messagesmake|messagesunique| \
+            runserver|startapp|startproject|syncdb| \
             validate)
                 COMPREPLY=()
                 return 0
Index: docs/settings.txt
===================================================================
--- docs/settings.txt	(Revision 6193)
+++ docs/settings.txt	(Arbeitskopie)
@@ -567,9 +567,9 @@
         ('en', gettext('English')),
     )
 
-With this arrangement, ``make-messages.py`` will still find and mark these
-strings for translation, but the translation won't happen at runtime -- so
-you'll have to remember to wrap the languages in the *real* ``gettext()`` in
+With this arrangement, ``django-admin messagesmake`` will still find and mark
+these strings for translation, but the translation won't happen at runtime --
+so you'll have to remember to wrap the languages in the *real* ``gettext()`` in
 any code that uses ``LANGUAGES`` at runtime.
 
 LOGIN_REDIRECT_URL
Index: docs/i18n.txt
===================================================================
--- docs/i18n.txt	(Revision 6193)
+++ docs/i18n.txt	(Arbeitskopie)
@@ -122,8 +122,8 @@
 
 (The caveat with using variables or computed values, as in the previous two
 examples, is that Django's translation-string-detecting utility,
-``make-messages.py``, won't be able to find these strings. More on
-``make-messages`` later.)
+``django-admin.py messagesmake``, won't be able to find these strings. More on
+``messagesmake`` later.)
 
 The strings you pass to ``_()`` or ``ugettext()`` can take placeholders,
 specified with Python's standard named-string interpolation syntax. Example::
@@ -384,12 +384,12 @@
 available translation strings and how they should be represented in the given
 language. Message files have a ``.po`` file extension.
 
-Django comes with a tool, ``bin/make-messages.py``, that automates the creation
+Django comes with a tool, ``django-admin.py messagesmake``, that automates the creation
 and upkeep of these files.
 
 To create or update a message file, run this command::
 
-    bin/make-messages.py -l de
+    django-admin.py messagesmake -l de
 
 ...where ``de`` is the language code for the message file you want to create.
 The language code, in this case, is in locale format. For example, it's
@@ -414,7 +414,7 @@
 
 .. admonition:: No gettext?
 
-    If you don't have the ``gettext`` utilities installed, ``make-messages.py``
+    If you don't have the ``gettext`` utilities installed, ``django-admin.py messagesmake``
     will create empty files. If that's the case, either install the ``gettext``
     utilities or just copy the English message file
     (``conf/locale/en/LC_MESSAGES/django.po``) and use it as a starting point;
@@ -431,7 +431,7 @@
 
     _("Welcome to my site.")
 
-...then ``make-messages.py`` will have created a ``.po`` file containing the
+...then ``django-admin.py messagesmake`` will have created a ``.po`` file containing the
 following snippet -- a message::
 
     #: path/to/python/module.py:23
@@ -464,21 +464,30 @@
 To reexamine all source code and templates for new translation strings and
 update all message files for **all** languages, run this::
 
-    make-messages.py -a
+    django-admin.py messagesmake -a
 
+Remove duplicate translations strings
+-------------------------------------
+
+Sometimes duplicate translations of the same message ID occur which are invalid
+for the Django underlying gettext mechanism. This tool merges the duplicates in
+the current directory recursively::
+
+    django-admin.py messagesunique
+
 Compiling message files
 -----------------------
 
 After you create your message file -- and each time you make changes to it --
 you'll need to compile it into a more efficient form, for use by ``gettext``.
-Do this with the ``bin/compile-messages.py`` utility.
+Do this with the ``django-admin.py messagescompile`` utility.
 
 This tool runs over all available ``.po`` files and creates ``.mo`` files,
 which are binary files optimized for use by ``gettext``. In the same directory
-from which you ran ``make-messages.py``, run ``compile-messages.py`` like
-this::
+from which you ran ``django-admin.py messagesmake``, run ``django-admin.py messagescompile``
+like this::
 
-   bin/compile-messages.py
+   django-admin.py messagescompile
 
 That's it. Your translations are ready for use.
 
@@ -586,7 +595,7 @@
               ('en', ugettext('English')),
           )
 
-      With this arrangement, ``make-messages.py`` will still find and mark
+      With this arrangement, ``django-admin.py messagesmake`` will still find and mark
       these strings for translation, but the translation won't happen at
       runtime -- so you'll have to remember to wrap the languages in the *real*
       ``ugettext()`` in any code that uses ``LANGUAGES`` at runtime.
@@ -703,12 +712,12 @@
       searched in that order for ``<language>/LC_MESSAGES/django.(po|mo)``
     * ``$PYTHONPATH/django/conf/locale/<language>/LC_MESSAGES/django.(po|mo)``
 
-To create message files, you use the same ``make-messages.py`` tool as with the
-Django message files. You only need to be in the right place -- in the directory
-where either the ``conf/locale`` (in case of the source tree) or the ``locale/``
-(in case of app messages or project messages) directory are located. And you
-use the same ``compile-messages.py`` to produce the binary ``django.mo`` files that
-are used by ``gettext``.
+To create message files, you use the same ``django-admin.py messagesmake`` tool as
+with the Django message files. You only need to be in the right place -- in the
+directory where either the ``conf/locale`` (in case of the source tree) or the
+``locale/`` (in case of app messages or project messages) directory are located.
+And you use the same ``django-admin.py messagescompile`` to produce the binary
+``django.mo`` files that are used by ``gettext``.
 
 Application message files are a bit complicated to discover -- they need the
 ``LocaleMiddleware``. If you don't use the middleware, only the Django message
@@ -718,13 +727,13 @@
 files. If your applications need to be delivered to other users and will
 be used in other projects, you might want to use app-specific translations.
 But using app-specific translations and project translations could produce
-weird problems with ``make-messages``: ``make-messages`` will traverse all
+weird problems with ``messagesmake``: ``messagesmake`` will traverse all
 directories below the current path and so might put message IDs into the
 project message file that are already in application message files.
 
 The easiest way out is to store applications that are not part of the project
 (and so carry their own translations) outside the project tree. That way,
-``make-messages`` on the project level will only translate strings that are
+``messagesmake`` on the project level will only translate strings that are
 connected to your explicit project and not strings that are distributed
 independently.
 
@@ -818,14 +827,14 @@
 ----------------------------------------
 
 You create and update the translation catalogs the same way as the other Django
-translation catalogs -- with the {{{make-messages.py}}} tool. The only
+translation catalogs -- with the ``messagesmake`` tool. The only
 difference is you need to provide a ``-d djangojs`` parameter, like this::
 
-    make-messages.py -d djangojs -l de
+    django-admin.py messagesmake -d djangojs -l de
 
 This would create or update the translation catalog for JavaScript for German.
-After updating translation catalogs, just run ``compile-messages.py`` the same
-way as you do with normal Django translation catalogs.
+After updating translation catalogs, just run ``django-admin.py messagescompile``
+the same way as you do with normal Django translation catalogs.
 
 Specialities of Django translation
 ==================================
Index: docs/django-admin.txt
===================================================================
--- docs/django-admin.txt	(Revision 6193)
+++ docs/django-admin.txt	(Arbeitskopie)
@@ -85,6 +85,12 @@
 
 .. _Tutorial 2: ../tutorial02/
 
+cleanup
+-------
+
+Can be run as a cronjob or directly to clean out old data from the database
+(only expired sessions at the moment).
+
 createcachetable <tablename>
 ----------------------------
 
@@ -314,6 +320,83 @@
 
     django-admin.py loaddata --verbosity=2
 
+messagescompile
+---------------
+
+Compiles .po files created with ``messagesmake`` to .mo files for use with
+the builtin gettext support.
+
+.. i18n documentation: ../i18n/#compiling-message-files
+
+--locale
+~~~~~~~~
+
+Use the ``--locale`` or ``-l`` option to specify the locale to process.
+If not provided all locales are processed.
+
+Example usage::
+
+    django-admin.py messagescompile --locale=br_PT
+
+messagesmake
+------------
+
+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. After making changes to the messages files you need to compile them
+with ``messagescompile`` for use with the builtin gettext support.
+
+.. i18n documentation: ../i18n/#message-files
+
+--all
+~~~~~
+
+Use the ``--all`` or ``-a`` option to update the message files for all
+available languages.
+
+Example usage::
+
+    django-admin.py messagesmake --all
+
+--locale
+~~~~~~~~
+
+Use the ``--locale`` or ``-l`` option to specify the locale to process.
+
+Example usage::
+
+    django-admin.py messagesmake --locale=br_PT
+
+--domain
+~~~~~~~~
+
+Use the ``--domain`` or ``-d`` option to change the domain of the messages files.
+Currently supported::
+
+    * ``django`` for all *.py and *.html files (default) 
+    * ``djangojs`` for *.js files
+
+--verbosity
+~~~~~~~~~~~
+
+Use ``--verbosity`` or ``-v`` to specify the amount of notification and debug
+information that ``django-admin.py`` should print to the console.
+
+	* ``0`` means no input.
+	* ``1`` means normal input (default).
+	* ``2`` means verbose input.
+
+Example usage::
+
+    django-admin.py messagesmake --verbosity=2
+
+messagesunique
+--------------
+
+Unifies duplicate translations of the same message ID in the messages
+files created with ``messagesmake``.
+
 reset <appname appname ...>
 ---------------------------
 
@@ -505,6 +588,14 @@
 Creates a Django app directory structure for the given app name in the current
 directory.
 
