How to install gnu gettext (>0.15) on windows? So I can produce .po/.mo files in Django

后端 未结 6 917
天命终不由人
天命终不由人 2020-12-19 02:17

When runing django make messages:

./manage.py makemessages -l pt

I get:

CommandError: Can\'t find msguniq. Mak         


        
6条回答
  •  醉话见心
    2020-12-19 02:42

    The easiest way is to download the precompiled binary installer. Download the "static" flavor of your Operating System (32bit or 64bit) and simple run the installer.

    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-iconv\bin value.

    To check if it's working, go to cmd, navigate to your project folder and type

    "manage makemessages -l de".

    You may have to configure the path to store translations. Create a dir named "locale" in your project dir and point to it at settings.py

    Also make sure to set the local path in settings.py file:

    LOCALE_PATHS = (
        BASE_DIR + 'locale/', )
    

提交回复
热议问题