For Mac users, after installing Homebrew and gettext as @Louis Barranqueiro says (steps 1 and 2):
- Install Homebrew :
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install GNU gettext :
brew install gettext
You shouldn't use brew link gettext --force
in step 3, because it is risky (as Brew advises if you try). A better workaround is to set a new PATH variable
for your virtual environment. So, in the postactivate
file, which is located in the bin folder of your virtual environment folder, type:
export TEMP_PATH=$PATH
export PATH=$PATH:/usr/local/Cellar/gettext/0.19.7/bin
Note that you have to replace 0.19.7
by the version that is installed in your machine.
And in your predeactivate
file, which is located in the same folder of postactivate
file, type:
export PATH=$TEMP_PATH
unset TEMP_PATH
Now you can use the python manage.py makemessages -l <desired_language>
without worries. :)
Cheers.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…