我想里面做Django应用翻译。
我跟随本教程 ,但我遇到的问题。
当我运行代码
python manage.py makemessages -l 'de'
我得到的错误
CommandError: Can't find msguniq. Make sure you have GNU gettext tools 0.15 or newer installed.
奇怪的是,我已经安装了gettext
Warning: gettext 0.19.8.1 is already installed and up-to-date
To reinstall 0.19.8.1, run `brew reinstall gettext`
我已经设定的设置:
# Translations
# Provide a lists of languages which your site supports.
LANGUAGES = (
('en', _('English')),
('de', _('German')),
)
# Set the default language for your site.
LANGUAGE_CODE = 'en'
# Tell Django where the project's translation files should be.
LOCALE_PATHS = (
os.path.join(BASE_DIR, 'locale'),
)
print(LOCALE_PATHS)
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
难道有谁知道什么会错呢?