Can't find msguniq. Make sure you have GNU gettext tools 0.15 or newer installed. (Django 1.8 and OSX ElCapitan)
Question:
I’m trying to internationalize a Django app by following the wonderful Django documentation. The problem is when I try to run command to create language files:
python manage.py makemessages -l fr
It outputs an error :
CommandError: Can't find msguniq. Make sure you have GNU gettext tools 0.15 or newer installed.
My configuration :
- OS : OSX El Capitan v10.11.3
- Python : v3.5
- Django : v1.8
Answers:
Install gettext GNU tools with Homebrew using Terminal
- Install Homebrew :
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install GNU gettext :
brew install gettext
- Create symlink :
brew link gettext --force
If you try running link gettext --force
it warns you:
Note that doing so can interfere with building software.
The safest way to use it is to add gettext binary to your path:
export PATH="/usr/local/opt/gettext/bin:$PATH"
For Windows:
-
Download gettext and install
-
Add in system var PATH: C:Program Filesgettext-iconvbin
(if you didn’t it during installation)
-
Check or create in your project directory locale/
-
Check or add in settings.py: LOCALE_PATHS = (BASE_DIR + 'locale/', )
Enjoy by django-admin makemessages -l fr
. If still repeating don’t forget to restart your shell to update env vars
First make dir in root project folder with name locale
then run
sudo apt install gettext
I’m trying to internationalize a Django app by following the wonderful Django documentation. The problem is when I try to run command to create language files:
python manage.py makemessages -l fr
It outputs an error :
CommandError: Can't find msguniq. Make sure you have GNU gettext tools 0.15 or newer installed.
My configuration :
- OS : OSX El Capitan v10.11.3
- Python : v3.5
- Django : v1.8
Install gettext GNU tools with Homebrew using Terminal
- Install Homebrew :
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install GNU gettext :
brew install gettext
- Create symlink :
brew link gettext --force
If you try running link gettext --force
it warns you:
Note that doing so can interfere with building software.
The safest way to use it is to add gettext binary to your path:
export PATH="/usr/local/opt/gettext/bin:$PATH"
For Windows:
-
Download gettext and install
-
Add in system var PATH:
C:Program Filesgettext-iconvbin
(if you didn’t it during installation) -
Check or create in your project directory
locale/
-
Check or add in settings.py:
LOCALE_PATHS = (BASE_DIR + 'locale/', )
Enjoy by django-admin makemessages -l fr
. If still repeating don’t forget to restart your shell to update env vars
First make dir in root project folder with name locale
then run
sudo apt install gettext