Answer the question
In order to leave comments, you need to log in
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',
)
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')),
)
D:\Project\>django-admin makemessages -i en -e html
CommandError: Can't find xgettext. Make sure you have GNU gettext tools 0.15 or newer installed.
Answer the question
In order to leave comments, you need to log in
What have I done wrong
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question