From fcf5a3cde6d1b6b8cd066ed1a3b0f37e20d89c23 Mon Sep 17 00:00:00 2001 From: Mark Walker Date: Tue, 7 May 2024 10:34:33 +0100 Subject: [PATCH] feat: Allow translation management from docker (#982) * feat: Allow translation management from docker * Added translation * Upgrade pip and pip-tools --- Dockerfile | 23 ++++++++++++++++------- docker-compose.yml | 2 -- locale/es/LC_MESSAGES/django.po | 2 +- rootfs/entrypoint.sh | 6 ++++++ 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3802346f4..6c1e426f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,25 +2,34 @@ FROM python:3.10.9-bullseye RUN apt-get update \ && apt-get upgrade -yq \ + && apt-get -y install locales \ + && apt-get -y install gettext \ + && apt-get -y install poedit \ && apt-get install -yq --no-install-recommends \ nodejs \ - npm + npm \ + && apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* -ENV APP_DIR=/var/www/app -WORKDIR ${APP_DIR} +RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \ + && sed -i -e 's/# en_US ISO-8859-1/en_US ISO-8859-1/' /etc/locale.gen \ + && sed -i -e 's/# en_US.ISO-8859-15 ISO-8859-15/en_US.ISO-8859-15 ISO-8859-15/' /etc/locale.gen \ + && dpkg-reconfigure --frontend=noninteractive locales \ + && update-locale -COPY requirements.txt ${APP_DIR}/requirements.txt +WORKDIR /var/www/app -RUN pip install pip-tools \ +COPY requirements.txt ./requirements.txt + +RUN pip install --upgrade pip pip-tools \ && pip-sync -COPY package.json ${APP_DIR}/package.json +COPY package.json ./package.json RUN npm install \ && npm install -g gulp COPY rootfs / -COPY . ${APP_DIR} +COPY . . RUN gulp local diff --git a/docker-compose.yml b/docker-compose.yml index e68f2f6d0..c56add22a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: "3.8" - services: app: container_name: djangogirls-app diff --git a/locale/es/LC_MESSAGES/django.po b/locale/es/LC_MESSAGES/django.po index 8cc791ead..19b4bb3a6 100644 --- a/locale/es/LC_MESSAGES/django.po +++ b/locale/es/LC_MESSAGES/django.po @@ -6170,7 +6170,7 @@ msgstr "" #: templates/organize/form/step3_organizers.html:114 #: templates/organize/form/step3_organizers.html:154 msgid "Email address" -msgstr "" +msgstr "Correo electrónico" #: templates/organize/form/step3_organizers.html:85 msgid "Your organizing team" diff --git a/rootfs/entrypoint.sh b/rootfs/entrypoint.sh index 62e2e82b1..b43d0952a 100755 --- a/rootfs/entrypoint.sh +++ b/rootfs/entrypoint.sh @@ -1,5 +1,11 @@ #!/bin/sh -e +echo "Make messages" +./manage.py makemessages --all + +echo "Compile messages" +./manage.py compilemessages + echo "Applying database migrations" ./manage.py migrate