Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django translation: can't find msguniq

I would like to do the translation inside Django application.

I was following the this tutorial but I run into problems.

After I run the code

python manage.py makemessages -l 'de'

I get the error

CommandError: Can't find msguniq. Make sure you have GNU gettext tools 0.15 or newer installed.

The weird thing is, that I have the gettext already installed

Warning: gettext 0.19.8.1 is already installed and up-to-date
To reinstall 0.19.8.1, run `brew reinstall gettext`

I have the settings set as:

# Translations
# Provide a lists of languages which your site supports.
LANGUAGES = (
    ('en', _('English')),
    ('de', _('German')),
)
# Set the default language for your site.
LANGUAGE_CODE = 'en'
# Tell Django where the project's translation files should be.
LOCALE_PATHS = (
    os.path.join(BASE_DIR, 'locale'),
)
print(LOCALE_PATHS)

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

Do anyone know what could go wrong?

like image 994
Marko Zadravec Avatar asked Oct 21 '25 04:10

Marko Zadravec


1 Answers

Check if you can run msguniq manually:

$ msguniq --help

If that gives you a command not found error, ensure that your PATH environment variable is set correctly for brew.

like image 86
Daniel Hepper Avatar answered Oct 22 '25 16:10

Daniel Hepper



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!