Fixed #18547 -- Improved error message when gettext is missing

This commit is contained in:
Claude Paroz 2012-07-17 22:04:47 +02:00
parent 23f94f0741
commit 8184aff2b0
1 changed files with 4 additions and 1 deletions

View File

@ -291,7 +291,10 @@ def make_messages(locale=None, domain='django', verbosity=1, all=False,
raise CommandError(message) raise CommandError(message)
# We require gettext version 0.15 or newer. # We require gettext version 0.15 or newer.
output = _popen('xgettext --version')[0] output, errors = _popen('xgettext --version')
if errors:
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) match = re.search(r'(?P<major>\d+)\.(?P<minor>\d+)', output)
if match: if match:
xversion = (int(match.group('major')), int(match.group('minor'))) xversion = (int(match.group('major')), int(match.group('minor')))