mirror of https://github.com/django/django.git
Removed check for 0.15 version of gettext tools
gettext 0.15 has been released in July 2006.
This commit is contained in:
parent
dc51ec8bc2
commit
51998dffe7
|
@ -250,18 +250,6 @@ class Command(NoArgsCommand):
|
||||||
"if you want to enable i18n for your project or application.")
|
"if you want to enable i18n for your project or application.")
|
||||||
|
|
||||||
check_programs('xgettext')
|
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)
|
potfile = self.build_pot_file(localedir)
|
||||||
|
|
||||||
|
|
|
@ -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
|
|
|
@ -8,6 +8,7 @@ import pickle
|
||||||
from threading import local
|
from threading import local
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.core.management.utils import find_command
|
||||||
from django.template import Template, Context
|
from django.template import Template, Context
|
||||||
from django.template.base import TemplateSyntaxError
|
from django.template.base import TemplateSyntaxError
|
||||||
from django.test import TestCase, RequestFactory
|
from django.test import TestCase, RequestFactory
|
||||||
|
@ -33,14 +34,13 @@ from django.utils.translation import (activate, deactivate,
|
||||||
npgettext, npgettext_lazy,
|
npgettext, npgettext_lazy,
|
||||||
check_for_language)
|
check_for_language)
|
||||||
|
|
||||||
from .commands.tests import can_run_extraction_tests, can_run_compilation_tests
|
if find_command('xgettext'):
|
||||||
if can_run_extraction_tests:
|
|
||||||
from .commands.extraction import (ExtractorTests, BasicExtractorTests,
|
from .commands.extraction import (ExtractorTests, BasicExtractorTests,
|
||||||
JavascriptExtractorTests, IgnoredExtractorTests, SymlinkExtractorTests,
|
JavascriptExtractorTests, IgnoredExtractorTests, SymlinkExtractorTests,
|
||||||
CopyPluralFormsExtractorTests, NoWrapExtractorTests,
|
CopyPluralFormsExtractorTests, NoWrapExtractorTests,
|
||||||
NoLocationExtractorTests, KeepPotFileExtractorTests,
|
NoLocationExtractorTests, KeepPotFileExtractorTests,
|
||||||
MultipleLocaleExtractionTests)
|
MultipleLocaleExtractionTests)
|
||||||
if can_run_compilation_tests:
|
if find_command('msgfmt'):
|
||||||
from .commands.compilation import (PoFileTests, PoFileContentsTests,
|
from .commands.compilation import (PoFileTests, PoFileContentsTests,
|
||||||
PercentRenderingTests, MultipleLocaleCompilationTests,
|
PercentRenderingTests, MultipleLocaleCompilationTests,
|
||||||
CompilationErrorHandling)
|
CompilationErrorHandling)
|
||||||
|
|
Loading…
Reference in New Issue