1

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?

Jarno Lamberg
  • 1,530
  • 12
  • 12
Gie
  • 1,907
  • 2
  • 24
  • 49

2 Answers2

15

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

brew install gettext
brew link gettext --force
Ludwik Trammer
  • 24,602
  • 6
  • 66
  • 90
  • 1
    Ludwik, thanks a lot. Linking was a missed step in my environment. Now everything works properly. – Gie Sep 30 '13 at 13:46
  • 1
    Sudo would not work for me. Instead, I and apparently some others on SO have needed to add the flag --force to the brew link command for it to have the expected effect. – Jarno Lamberg May 22 '14 at 12:43
  • Don't use sudo! Use --force. – melbic Mar 16 '15 at 15:50
2

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.

José L. Patiño
  • 3,683
  • 2
  • 29
  • 28