Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@claudep claudep authored
View
12 django/core/management/commands/makemessages.py
@@ -250,18 +250,6 @@ def handle_noargs(self, *args, **options):
"if you want to enable i18n for your project or application.")
check_programs('xgettext')
- # We require gettext version 0.15 or newer.
- output, errors, status = popen_wrapper(['xgettext', '--version'])
- if status != STATUS_OK:
- raise CommandError("Error running xgettext. Note that Django "
- "internationalization requires GNU gettext 0.15 or newer.")
- match = re.search(r'(?P<major>\d+)\.(?P<minor>\d+)', output)
- if match:
- xversion = (int(match.group('major')), int(match.group('minor')))
- if xversion < (0, 15):
- raise CommandError("Django internationalization requires GNU "
- "gettext 0.15 or newer. You are using version %s, please "
- "upgrade your gettext toolset." % match.group())
potfile = self.build_pot_file(localedir)
View
24 tests/i18n/commands/tests.py
@@ -1,24 +0,0 @@
-import os
-import re
-from subprocess import Popen, PIPE
-
-from django.core.management.utils import find_command
-
-can_run_extraction_tests = False
-can_run_compilation_tests = False
-
-# checks if it can find xgettext on the PATH and
-# imports the extraction tests if yes
-xgettext_cmd = find_command('xgettext')
-if xgettext_cmd:
- p = Popen('%s --version' % xgettext_cmd, shell=True, stdout=PIPE, stderr=PIPE, close_fds=os.name != 'nt', universal_newlines=True)
- output = p.communicate()[0]
- match = re.search(r'(?P<major>\d+)\.(?P<minor>\d+)', output)
- if match:
- xversion = (int(match.group('major')), int(match.group('minor')))
- if xversion >= (0, 15):
- can_run_extraction_tests = True
- del p
-
-if find_command('msgfmt'):
- can_run_compilation_tests = True
View
6 tests/i18n/tests.py
@@ -8,6 +8,7 @@
from threading import local
from django.conf import settings
+from django.core.management.utils import find_command
from django.template import Template, Context
from django.template.base import TemplateSyntaxError
from django.test import TestCase, RequestFactory
@@ -33,14 +34,13 @@
npgettext, npgettext_lazy,
check_for_language)
-from .commands.tests import can_run_extraction_tests, can_run_compilation_tests
-if can_run_extraction_tests:
+if find_command('xgettext'):
from .commands.extraction import (ExtractorTests, BasicExtractorTests,
JavascriptExtractorTests, IgnoredExtractorTests, SymlinkExtractorTests,
CopyPluralFormsExtractorTests, NoWrapExtractorTests,
NoLocationExtractorTests, KeepPotFileExtractorTests,
MultipleLocaleExtractionTests)
-if can_run_compilation_tests:
+if find_command('msgfmt'):
from .commands.compilation import (PoFileTests, PoFileContentsTests,
PercentRenderingTests, MultipleLocaleCompilationTests,
CompilationErrorHandling)

2 comments on commit 51998df

@claudep
Collaborator

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.