Repository navigation
Description
Please verify that this bug has NOT been raised before.
- I checked and didn't find a similar issue
Describe the bug*
I am writing to report a localization gap in the standard Docker deployment, which causes the application to fail to render localized text (such as field label and help_text served by the backend API) when switching to any language other than English.
Root Cause:
After digging into the git history, I found that commit d557d2d modified the invoke update command and decoupled the localization generation logic from it. I assume the intention was to keep the container runtime environment clean and stateless, preventing the container from modifying source artifacts during startup (which makes total sense).
However, because *.mo files are excluded by .gitignore, removing this step from the runtime lifecycle without introducing it to the Docker image build stage (Dockerfile) leaves the localization pipeline uncompleted. In a production container environment, the backend currently has no way to serve compiled translation binaries out-of-the-box.
Steps to Reproduce
- Deploy InvenTree using the standard Docker / Docker-compose environment.
- Switch the application language to any language other than English (e.g., German, French, or Chinese).
- Inspect any dynamically rendered form and check its backend API response. (e.g.,
OPTIONS /api/part/) - Notice that fields fallback to English because the backend cannot load .mo translations.
- Manually run
python manage.py compilemessagesinside the backend container and restart it, the translations instantly load correctly.
Expected behaviour
To close this loop while respecting the philosophy of keeping runtime clean, the translation messages should be compiled during the Docker image build phase in the Dockerfile (e.g., RUN python manage.py compilemessages or via an equivalent invoke task during multi-stage build).
Before I open a Pull Request to fix this, I wanted to check in with the team to confirm your thoughts: Is this an overlooked gap from the previous refactoring, or is there an alternative preferred pattern for handling production i18n in InvenTree Docker images?
Deployment Method
Docker
Version Information
Inventree Version: 1.3.5
Try to reproduce on the demo site
I tried to reproduce
Is the bug reproducible on the demo site?
Reproducible
Activity
SchrodingersGat commentedon Jun 17, 2026
@geekcj12 thanks for raising this issue - this is an oversight, and certainly not intentional. The compiled translations should 100% be available in "off the shelf" docker image.
If you are able to submit a fix for this, that's great. It would be good also to add a unit test to ensure that the message files are present in the built image
geekcj12 commentedon Jun 18, 2026
Thanks for the quick confirmation. It makes total sense to ensure this with a unit test. I am on it—I'll implement the fix in the Dockerfile and add a corresponding test case to assert that the compiled translation assets are present. Will open a PR shortly.