diff --git a/.gitignore b/.gitignore index f0eca7899..a7186c072 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ .env .venv *.egg-info +*.mo *.pyc *.sqlite3 build diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d16f101a0..004a621de 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,6 +23,8 @@ database before running bootstrap or `make migrate` and `make test` will fail. # to get mysql client to install # export LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" make bootstrap +# If you update locale .po files, compile messages before running/testing +make compilemessages # If you want to enable DEBUG (and development mode) echo 1 > ~/.config/promgen/DEBUG diff --git a/Dockerfile b/Dockerfile index 8359f53c5..89915035e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,6 +47,10 @@ COPY promgen/tests/examples/promgen.yml /etc/promgen/promgen.yml WORKDIR /usr/src/app RUN pip install --no-cache-dir -e . +RUN set -ex \ + && apk add --no-cache gettext \ + && SECRET_KEY=1 promgen compilemessages \ + && apk del gettext USER promgen EXPOSE 8000 diff --git a/Makefile b/Makefile index 20d332ada..1ea5b5944 100644 --- a/Makefile +++ b/Makefile @@ -122,6 +122,11 @@ ruff-check-format: $(RUFF_BIN) migrate: $(APP_BIN) $(APP_BIN) migrate +.PHONY: compilemessages +## Django: Compile locale messages (.po -> .mo) +compilemessages: $(APP_BIN) + $(APP_BIN) compilemessages + .PHONY: run ## Django: Run development server run: migrate diff --git a/promgen/locale/ja/LC_MESSAGES/django.mo b/promgen/locale/ja/LC_MESSAGES/django.mo deleted file mode 100644 index 49cf7aed4..000000000 Binary files a/promgen/locale/ja/LC_MESSAGES/django.mo and /dev/null differ