Мои настройки
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')),
)
создал папку locale
Использую команду
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.
Что я сделал не так