Search code examples
javascriptdjangointernationalization

Unable to generate django javascript i18n catalog


I am trying to generate the JS catalog for translating my JS strings.

Folowing the docs, I am trying

$ django-admin.py makemessages -d djangojs -l de
processing locale de
CommandError: errors happened while running msguniq
msguniq: error while opening "[project_root]/locale/djangojs.pot" for reading: No such file or directory
$ man msguniq
$ django-admin.py makemessages -d django -l de
processing locale de
$ 

Which fails, but makemessages works for django domain.


Solution

  • The problem was that there was no string to be translated (the error message could be better!). Adding a translatable string (e.g. {% trans 'dummy' %}) fixed it.

    Another problem could be outdated gettext version, try upgrading it:

    apt-get install gettext