Reputation: 2639
If I execute the following in a Divio Cloud (formerly known as "Aldryn") project:
docker-compose run --rm web python manage.py makemessages
I get:
CommandError: Can't find xgettext. Make sure you have GNU gettext tools 0.15 or newer installed.
As a workaround I have added this to the Dockerfile
:
# add gettext for manage.py makemessages
RUN apt-get update && apt-get install -y gettext
and then
docker-compose build web
Upvotes: 1
Views: 511
Reputation: 7780
Currently Aldryn does not support generating the .mo files for you. While waiting for Aldryn itself to provide support for this out of the box, you can work around the issue by editing the Dockerfile, as you already did:
1) Towards the top, just before the # <DOCKER_BUILD>
, add the following command (as you already pointed out):
# add gettext for manage.py makemessages
RUN apt-get update && apt-get install -y gettext && apt-get clean && rm -rf /var/lib/apt/lists/*
2) At the bottom, just after the # </DOCKER_BUILD>
, add the following command:
# compile the messages
RUN DJANGO_MODE=build python manage.py compilemessages
Edit: If you're using baseproject>=3.13.1, step 1) is not needed anymore.
Upvotes: 4