gpt4 book ai didi

python - Django 翻译 : can't find msguniq

转载 作者:行者123 更新时间:2023-12-05 08:08:14 24 4
gpt4 key购买 nike

我想在 Django 应用程序中进行翻译。

我正在关注 this tutorial但我遇到了问题。

运行代码后

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',
]

有谁知道会出什么问题吗?

最佳答案

检查您是否可以手动运行 msguniq:

$ msguniq --help

如果出现命令未找到错误,请确保为 brew 正确设置了 PATH 环境变量。

关于python - Django 翻译 : can't find msguniq,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50855974/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com