Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

build: add lingui compile step to docker build

Brad Barbind7229d36d2b0
diff --git a/.husky/pre-commit b/.husky/pre-commit
index 73ab56c0d3..a49b292e6d 100755
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -3,6 +3,15 @@
npx lint-staged
+# Compile lingui translations if any relevant files were modified
+if git diff --cached --name-only | grep -qE '\.(tsx?|jsx?)$|\.po$'; then
+ echo "Compiling translations..."
+ npm run lingui:compile
+
+ # Add compiled locale files to the commit
+ git add packages/locale/locales/**/*.mjs packages/locale/locales/**/*.po
+fi
+
# Regenerate MCP tools if any .service.ts file was modified
if git diff --cached --name-only | grep -q '\.service\.ts$'; then
npx tsx scripts/generate-mcp.ts
diff --git a/apps/erp/Dockerfile b/apps/erp/Dockerfile
index 88ba7058bd..7525a6a30c 100644
--- a/apps/erp/Dockerfile
+++ b/apps/erp/Dockerfile
@@ -14,6 +14,7 @@ FROM deps AS build
ARG NODE_OPTIONS
ENV NODE_OPTIONS="--max-old-space-size=8024"
# Build only ERP and its deps
+RUN npx lingui compile --namespace es
RUN npx turbo run build --filter=./apps/erp
FROM node:22-slim
diff --git a/apps/mes/Dockerfile b/apps/mes/Dockerfile
index 262eda5f26..898db15291 100644
--- a/apps/mes/Dockerfile
+++ b/apps/mes/Dockerfile
@@ -14,6 +14,7 @@ FROM deps AS build
ARG NODE_OPTIONS
ENV NODE_OPTIONS="--max-old-space-size=4096"
# Build only MES and its deps
+RUN npx lingui compile --namespace es
RUN npx turbo run build --filter=./apps/mes
FROM node:22-slim