Author: jezdez
Date: 2010-02-16 06:12:13 -0600 (Tue, 16 Feb 2010)
New Revision: 12439

Modified:
   django/trunk/django/core/management/commands/makemessages.py
Log:
Fixed #11284 - Stop forcing the use of the djangojs domain when the ".js" file 
extension is passed to makemessages management command. Thanks, Ramiro Morales.

Modified: django/trunk/django/core/management/commands/makemessages.py
===================================================================
--- django/trunk/django/core/management/commands/makemessages.py        
2010-02-15 17:54:13 UTC (rev 12438)
+++ django/trunk/django/core/management/commands/makemessages.py        
2010-02-16 12:12:13 UTC (rev 12439)
@@ -7,6 +7,7 @@
 from subprocess import PIPE, Popen
 
 from django.core.management.base import CommandError, BaseCommand
+from django.utils.text import get_text_list
 
 pythonize_re = re.compile(r'\n\s*//')
 
@@ -108,7 +109,7 @@
         all_files.sort()
         for dirpath, file in all_files:
             file_base, file_ext = os.path.splitext(file)
-            if domain == 'djangojs' and file_ext == '.js':
+            if domain == 'djangojs' and file_ext in extensions:
                 if verbosity > 1:
                     sys.stdout.write('processing file %s in %s\n' % (file, 
dirpath))
                 src = open(os.path.join(dirpath, file), "rU").read()
@@ -200,14 +201,14 @@
         domain = options.get('domain')
         verbosity = int(options.get('verbosity'))
         process_all = options.get('all')
-        extensions = options.get('extensions') or ['html']
+        extensions = options.get('extensions')
 
         if domain == 'djangojs':
-            extensions = []
+            extensions = handle_extensions(extensions or ['js'])
         else:
-            extensions = handle_extensions(extensions)
+            extensions = handle_extensions(extensions or ['html'])
 
-        if '.js' in extensions:
-            raise CommandError("JavaScript files should be examined by using 
the special 'djangojs' domain only.")
+        if verbosity > 1:
+            sys.stdout.write('examining files with the extensions: %s\n' % 
get_text_list(list(extensions), 'and'))
 
         make_messages(locale, domain, verbosity, process_all, extensions)

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to