Question

I'm trying to translate my applications in my Django project. My development machine works under control OSX Mountain Lion, which out of the box doesn't have installed gettext, so I've installed this application with Homebrew:

brew install gettext

This command installed gettext-0.18.3.1.

After that I try to generate messages to my applications:

python manage.py makemessages -l pl

in result I get message:

CommandError: Error running xgettext. Note that Django internationalization requires GNU gettext 0.15 or newer.

Do you have any advice how to launch translation process on Mountain Lion with gettext installed via Homebrew?

Was it helpful?

Solution

gettext is probably not on the PATH. This should work:

brew install gettext
brew link gettext --force

OTHER TIPS

What Ludwik Trammer comment brew commands does is automatically linking the contents of /usr/local/Cellar/gettext/{VERSION}/bin/ into /usr/local/bin/.

If somebody arrives here and the sudo brew link gettext command is not working or returning warnings to him/her (because running brew with sudo is not usually a good option) it is possible to do the same manually, with no root privileges, like this:

DIR=/usr/local/Cellar/gettext/{VERSION}/bin/
for n in `ls $DIR`; do ln -s $DIR$n /usr/local/bin/$n; done

Then you have all the gettext related commands properly linked in your local bin directory.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top