summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2011-01-25 01:39:39 +0000
committerRamiro Morales <cramm0@gmail.com>2011-01-25 01:39:39 +0000
commit7c888a7aa945352193303b557cbf654957e0dd45 (patch)
tree0989d595750eb2b678cebb4ed5e089aa8bac2b9c
parent91c61c0baac6b35b2ae191dc6333c26fd567ff1e (diff)
Fixed #14419 -- Enhanced the help text of the makemessages management command. Thanks lsaffre for the report and suggestions and gruszczy for the patch.
Also, removed the sterile make-messages.py, compile-messages.py scripts and dead compatibility code in makemessages. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15302 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rwxr-xr-xdjango/bin/compile-messages.py11
-rwxr-xr-xdjango/bin/make-messages.py11
-rw-r--r--django/core/management/commands/makemessages.py16
3 files changed, 8 insertions, 30 deletions
diff --git a/django/bin/compile-messages.py b/django/bin/compile-messages.py
deleted file mode 100755
index 0deaf6a178..0000000000
--- a/django/bin/compile-messages.py
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env python
-
-if __name__ == "__main__":
- import sys
- name = sys.argv[0]
- args = ' '.join(sys.argv[1:])
- print >> sys.stderr, "%s has been moved into django-admin.py" % name
- print >> sys.stderr, 'Please run "django-admin.py compilemessages %s" instead.'% args
- print >> sys.stderr
- sys.exit(1)
-
diff --git a/django/bin/make-messages.py b/django/bin/make-messages.py
deleted file mode 100755
index 1c84416423..0000000000
--- a/django/bin/make-messages.py
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env python
-
-if __name__ == "__main__":
- import sys
- name = sys.argv[0]
- args = ' '.join(sys.argv[1:])
- print >> sys.stderr, "%s has been moved into django-admin.py" % name
- print >> sys.stderr, 'Please run "django-admin.py makemessages %s" instead.'% args
- print >> sys.stderr
- sys.exit(1)
-
diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
index 7c31721752..115607633d 100644
--- a/django/core/management/commands/makemessages.py
+++ b/django/core/management/commands/makemessages.py
@@ -145,11 +145,7 @@ def make_messages(locale=None, domain='django', verbosity='1', all=False,
raise CommandError("currently makemessages 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"
+ message = "Type '%s help %s' for usage information." % (os.path.basename(sys.argv[0]), sys.argv[1])
raise CommandError(message)
# We require gettext version 0.15 or newer.
@@ -301,11 +297,11 @@ def make_messages(locale=None, domain='django', verbosity='1', all=False,
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list + (
make_option('--locale', '-l', default=None, dest='locale',
- help='Creates or updates the message files only for the given locale (e.g. pt_BR).'),
+ help='Creates or updates the message files for the given locale (e.g. pt_BR).'),
make_option('--domain', '-d', default='django', dest='domain',
help='The domain of the message files (default: "django").'),
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.'),
+ default=False, help='Updates the message files for all existing locales.'),
make_option('--extension', '-e', dest='extensions',
help='The file extension(s) to examine (default: ".html", separate multiple extensions with commas, or use -e multiple times)',
action='append'),
@@ -320,7 +316,11 @@ class Command(NoArgsCommand):
make_option('--no-obsolete', action='store_true', dest='no_obsolete',
default=False, help="Remove obsolete message strings"),
)
- 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."
+ 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 projects and "
+"applications) directory.\n\nYou must run this command with one of either the "
+"--locale or --all options.")
requires_model_validation = False
can_import_settings = False