Error /bin/sh Xgettext Command Not Found
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings msguniq: command not found and policies of this site About Us Learn more about Stack Overflow
Msguniq Windows
the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags install gettext mac Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only
Brew Install Gettext
takes a minute: Sign up Internationalisation Django (on OSX) up vote 23 down vote favorite 10 I'm trying to get gettext to work in Django on my OSX Leopard django_manage.py makemessages -l nl Importing Django settings module settings processing language nl Error: errors happened while running xgettext on __init__.py /bin/sh: xgettext: command not found In Terminal I get the same django makemessages error, unless I put this in my bash profile: PATH=$PATH:/Applications/Poedit.app/Contents/MacOS/ But then I get this error: Error: errors happened while running msguniq /bin/sh: msguniq: command not found os x python django unix internationalization gettext share|improve this question asked Jul 28 '11 at 14:00 Cluesane 11613 add a comment| 2 Answers 2 active oldest votes up vote 83 down vote After installing, try linking gettext. This solved the problem for me. brew install gettext brew link gettext --force share|improve this answer edited Jun 26 '15 at 12:24 Cesar Canassa 5,37922548 answered Mar 20 '12 at 13:31 dominik 2,21431927 That command also solved my next issue : Error: errors happened while running msguniq /bin/sh: msguniq: command not found –vinyll Jul 17 '12 at 9:34 13 I had to add --force to the last command. –Emil Stenström Apr 22 '13 at 11:22 1 My main problem was that I didn't run the brew link --force gettext command. Once I ran it, everything worked like a charm. Thank you! –aka_le_Mulder Jul 26 '13 at 6:33 Could you
Mac has the right library to generate translation files. Installing gettext If you run the following command in Terminal: $ django-admin.py makemessages -a You will probably get the following error /bin/sh: xgettext: command not found The reason for this is that the gettext library is not installed. Installation from source (failed) I have tried to download the gettext source (if not available, check the gettext site: www.gnu.org/software/gettext/) Uncompress the package in finder, then in Terminal cd to it: $ cd /your/path/gettext-0.18.1.1 $ ./configure $ make $ make install But then I got the following error: stpncpy.c:34: error: expected http://stackoverflow.com/questions/6860188/internationalisation-django-on-osx declaration specifiers or ‘...’ before numeric constantstpncpy.c:34: error: expected ‘)’ before ‘!=’ token stpncpy.c:34: error: expected ‘)’ before ‘?’ token make[3]: *** [stpncpy.lo] Error 1 make[2]: *** [install] Error 2 make[1]: *** [install-recursive] Error 1 make: *** [install-recursive] Error 1 It seems like it won't compile on Lion. So here's the other way. Installation with Homebrew So instead I'm installing it using Homebrew (a package installer for http://gpiot.com/blog/django-internationalization-on-osx-lion/ Mac OS), follow those instructions to install it. Once brew is installed, run the following command: $ brew install gettext $ sudo brew link gettext Then you must add that package to your path: $echo 'export PATH=/usr/local/Cellar/gettext/0.18.1.1/bin:$PATH' >> ~/.profile * Make sure that your path is correct as well! Or you will get the following error: /bin/sh: msguniq: command not found We should be good to go to the next step now. Generating language files One thing the Django admin command won't do, is creating the locale folders. So in your project directory (or app directory) add the following folder structure (one for each language): Those folder will indicate in which language your project needs to be localised. Then run the following command to generate the language files $ django-admin.py makemessages -a This command will compile all the languages at once (for more specific command check the Django docs). So you will get something like that: The PO file contains the original translation string followed byt the translated one (French example): #: map/forms.py:9 msgid "Hello" msgstr "Bonjour" Once you (or the translator) have completed all the translations in that PO file, you can run the compile command: $ django-admin.py compilemessages
von GoogleAnmeldenAusgeblendete FelderNach Gruppen oder Nachrichten suchen