Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Removed check for 0.15 version of gettext tools

gettext 0.15 has been released in July 2006.
  • Loading branch information...
commit 51998dffe7ef18d314daf23e8e2ef1e2c0891d32 1 parent dc51ec8
Claude Paroz authored May 22, 2013
12  django/core/management/commands/makemessages.py
@@ -250,18 +250,6 @@ def handle_noargs(self, *args, **options):
250 250
                     "if you want to enable i18n for your project or application.")
251 251
 
252 252
         check_programs('xgettext')
253  
-        # We require gettext version 0.15 or newer.
254  
-        output, errors, status = popen_wrapper(['xgettext', '--version'])
255  
-        if status != STATUS_OK:
256  
-            raise CommandError("Error running xgettext. Note that Django "
257  
-                        "internationalization requires GNU gettext 0.15 or newer.")
258  
-        match = re.search(r'(?P<major>\d+)\.(?P<minor>\d+)', output)
259  
-        if match:
260  
-            xversion = (int(match.group('major')), int(match.group('minor')))
261  
-            if xversion < (0, 15):
262  
-                raise CommandError("Django internationalization requires GNU "
263  
-                        "gettext 0.15 or newer. You are using version %s, please "
264  
-                        "upgrade your gettext toolset." % match.group())
265 253
 
266 254
         potfile = self.build_pot_file(localedir)
267 255
 
24  tests/i18n/commands/tests.py
... ...
@@ -1,24 +0,0 @@
1  
-import os
2  
-import re
3  
-from subprocess import Popen, PIPE
4  
-
5  
-from django.core.management.utils import find_command
6  
-
7  
-can_run_extraction_tests = False
8  
-can_run_compilation_tests = False
9  
-
10  
-# checks if it can find xgettext on the PATH and
11  
-# imports the extraction tests if yes
12  
-xgettext_cmd = find_command('xgettext')
13  
-if xgettext_cmd:
14  
-    p = Popen('%s --version' % xgettext_cmd, shell=True, stdout=PIPE, stderr=PIPE, close_fds=os.name != 'nt', universal_newlines=True)
15  
-    output = p.communicate()[0]
16  
-    match = re.search(r'(?P<major>\d+)\.(?P<minor>\d+)', output)
17  
-    if match:
18  
-        xversion = (int(match.group('major')), int(match.group('minor')))
19  
-        if xversion >= (0, 15):
20  
-            can_run_extraction_tests = True
21  
-    del p
22  
-
23  
-if find_command('msgfmt'):
24  
-    can_run_compilation_tests = True
6  tests/i18n/tests.py
@@ -8,6 +8,7 @@
8 8
 from threading import local
9 9
 
10 10
 from django.conf import settings
  11
+from django.core.management.utils import find_command
11 12
 from django.template import Template, Context
12 13
 from django.template.base import TemplateSyntaxError
13 14
 from django.test import TestCase, RequestFactory
@@ -33,14 +34,13 @@
33 34
     npgettext, npgettext_lazy,
34 35
     check_for_language)
35 36
 
36  
-from .commands.tests import can_run_extraction_tests, can_run_compilation_tests
37  
-if can_run_extraction_tests:
  37
+if find_command('xgettext'):
38 38
     from .commands.extraction import (ExtractorTests, BasicExtractorTests,
39 39
         JavascriptExtractorTests, IgnoredExtractorTests, SymlinkExtractorTests,
40 40
         CopyPluralFormsExtractorTests, NoWrapExtractorTests,
41 41
         NoLocationExtractorTests, KeepPotFileExtractorTests,
42 42
         MultipleLocaleExtractionTests)
43  
-if can_run_compilation_tests:
  43
+if find_command('msgfmt'):
44 44
     from .commands.compilation import (PoFileTests, PoFileContentsTests,
45 45
         PercentRenderingTests, MultipleLocaleCompilationTests,
46 46
         CompilationErrorHandling)

2 notes on commit 51998df

Claude Paroz
Owner

Leaving in the docs that we require gettext 0.15 does not harm, IMHO. I just didn't want the code check which is probably unneeded now.

Please sign in to comment.
Something went wrong with that request. Please try again.