F
F
fantom_ask2020-08-10 14:09:15
Django
fantom_ask, 2020-08-10 14:09:15

CommandError: Can't find xgettext. Make sure you have GNU gettext tools 0.15 or newer installed. in django-admin makemessages how to fix?

My
settings.py

INSTALLED_APPS = [
  'modeltranslation', 
  'django.contrib.admin',
  'django.contrib.sites',
  'django.contrib.flatpages', 
]

USE_I18N = True

LOCALE_PATHS = ( os.path.join(BASE_DIR, 'locale'), )

gettext = lambda s: s 


LANGUAGES = (
('ru', gettext('Russia')),
('en', gettext('English')),
)

SITE_ID = 1

TEMPLATE_CONTEXT_PROCESSORS = ( 
  'django.contrib.auth.context_processors.auth', 
  'django.core.context_processors.debug', 
  'django.core.context_processors.i18n', 
  # this one 
  'django.core.context_processors.request', 
  'django.core.context_processors.static', 
  'django.contrib.messages.context_processors.messages', 
)


urls.py

from django.conf.urls.i18n import i18n_patterns

urlpatterns = [
  path('admin/', admin.site.urls),
  path('log/', include('django.contrib.auth.urls')),  
  path('i18n/', include('django.conf.urls.i18n')),  
]
urlpatterns += i18n_patterns(
  path('pages/', include('django.contrib.flatpages.urls')),
  path('contact/', include('contact.urls')),
)

created a folder locale I
use the command

D:\Project\>django-admin makemessages -i en -e html

And an error appears

CommandError: Can't find xgettext. Make sure you have GNU gettext tools 0.15 or newer installed.

What have I done wrong

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2020-08-10
@fantom_ask

What have I done wrong

Didn't read the documentation , it has the answer.

S
Sergey Tikhonov, 2020-08-10
@tumbler

apt install gettext

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question