- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想在 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/
我想在 Django 应用程序中进行翻译。 我正在关注 this tutorial但我遇到了问题。 运行代码后 python manage.py makemessages -l 'de' 我得到了错误
https://www.youtube.com/watch?v=AlJ8cGbk8ps我关注了这个视频,当我执行这个命令时django-admin makemessages -l ar 它给了我这个错
我已经成功安装了 msguniq(可以检查它的版本),我尝试更改与 windows xp 的兼容性并以管理员身份运行它,但我仍然收到此错误: CommandError: Can't find msgu
我遵循了在 Windows 上安装 gettext 的指导,当我在命令提示符中键入 xgettext --version 时,它说它已安装。但是当我想运行这个命令时: python manage.py
我正在尝试通过遵循精彩的 Django 文档来国际化 Django 应用程序。问题是当我尝试运行命令来创建语言文件时: python manage.py makemessages -l fr 它输出一
我是一名优秀的程序员,十分优秀!