django可以生成exe文件吗_如何在Windows上安装gnu gettext(> 0.15)?所以我可以在Django中生成.po / .mo文件...

When runing django make messages:

./manage.py makemessages -l pt

I get:

CommandError: Can't find msguniq. Make sure you have GNU gettext tools 0.15 or newer installed.

I tried to install but the last version I find with an Instalation Setup is 0.14. Where may I find a recent version and how do I install it?

解决方案

Django removed this explanation from the recent docs and it took me some time to found it so i pasted it here before this old documentation goes offline:

Download the following zip files from the GNOME servers

gettext-runtime-X.zip

gettext-tools-X.zip

X is the version number (It needs to be 0.15 or higher)

Extract the contents of the bin\ directories in both files to the same folder on your system (i.e. C:\Program Files\gettext-utils)

Update the system PATH:

Control Panel > System > Advanced > Environment Variables

In the System variables list, click Path, click Edit and then New.

Add C:\Program Files\gettext-utils\bin value.

You may also use gettext binaries you have obtained elsewhere, so long as the xgettext --version command works properly. Do not attempt to use Django translation utilities with a gettext package if the command xgettext --version entered at a Windows command prompt causes a popup window saying “xgettext.exe has generated errors and will be closed by Windows”.

After doing this I tested and ./manage.py makemessages -l pt works

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值