找不到msguniq。确保安装了GNU gettext工具0.15或更新版本。 (Django 1.8和OSX ElCapitan)

时间:2022-02-26 23:12:29

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:

我正在尝试通过遵循精彩的Django文档来国际化Django应用程序。问题是当我尝试运行命令来创建语言文件时:

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
  • 操作系统:OSX El Capitan v10.11.3
  • Python : v3.5
  • Python:v3.5
  • Django : v1.8
  • Django:v1.8

2 个解决方案

#1


12  

Install gettext GNU tools with Homebrew using Terminal

使用Terminal安装带有Homebrew的gettext GNU工具

  1. Install Homebrew : /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. 安装Homebrew:/ usr / bin / ruby​​ -e“$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
  3. Install GNU gettext : brew install gettext
  4. 安装GNU gettext:brew install gettext
  5. Create symlink : brew link gettext --force
  6. 创建符号链接:brew链接gettext --force

#2


2  

If you try running link gettext --force it warns you:

如果您尝试运行链接gettext --force,它会警告您:

Note that doing so can interfere with building software.

请注意,这样做会干扰构建软件。

The safest way to use it is to add gettext binary to your path:

最安全的方法是在路径中添加gettext二进制文件:

export PATH="/usr/local/opt/gettext/bin:$PATH"

#1


12  

Install gettext GNU tools with Homebrew using Terminal

使用Terminal安装带有Homebrew的gettext GNU工具

  1. Install Homebrew : /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. 安装Homebrew:/ usr / bin / ruby​​ -e“$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
  3. Install GNU gettext : brew install gettext
  4. 安装GNU gettext:brew install gettext
  5. Create symlink : brew link gettext --force
  6. 创建符号链接:brew链接gettext --force

#2


2  

If you try running link gettext --force it warns you:

如果您尝试运行链接gettext --force,它会警告您:

Note that doing so can interfere with building software.

请注意,这样做会干扰构建软件。

The safest way to use it is to add gettext binary to your path:

最安全的方法是在路径中添加gettext二进制文件:

export PATH="/usr/local/opt/gettext/bin:$PATH"