feat(i18n): nl at root URLs + keep devtools in the docker demo

Serve the source locale (nl) at / instead of /nl/: angular.json sourceLocale is now
{ code: 'nl', subPath: '' } → nl output at browser/ root (base href /), en stays /en/.
Rework localeLinks (nl → bare path, en → /en/…) + spec, and serve-i18n.mjs (nl assets at
root, en under /en/, / serves the nl index). And build the docker demo (+ serve:i18n) with
`--configuration development --localize` so isDevMode() stays true and the dev `⚙ state`
panel + role/scenario switchers render in the localized compose demo (they were correctly
gated off in the previous production build). Verified: nl base href /, en /en/, ngDevMode present.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
eho
2026-07-23 19:24:33 +02:00
co-authored by Claude Opus 4.8
parent deb5d77e04
commit c00e607b8f
6 changed files with 35 additions and 31 deletions
+6 -5
View File
@@ -1,8 +1,9 @@
# ponytail: dev-server images (not multi-stage prod builds) — this is a demo.
# `docker compose up` → app at http://localhost:4200 (LOCALIZED: /nl/ + /en/, the header
# language switcher works), Swagger at http://localhost:5000/swagger. The web container does a
# one-time `ng build --localize` then serves both locale bundles statically (with /api proxied);
# for a fast HMR loop use `npm start` locally instead (nl-only at /).
# `docker compose up` → app at http://localhost:4200 (LOCALIZED: nl at /, en at /en/, the header
# language switcher works, and the dev `⚙ state` panel stays visible), Swagger at :5000/swagger.
# The web container does a one-time `ng build --configuration development --localize` (development
# config keeps isDevMode()=true so the dev tools render) then serves both locale bundles
# statically (with /api proxied); for a fast HMR loop use `npm start` locally instead (nl at /).
services:
api:
image: mcr.microsoft.com/dotnet/sdk:10.0
@@ -37,7 +38,7 @@ services:
# once (`ng build --localize`) then serves them statically via scripts/serve-i18n.mjs
# (per-locale SPA fallback + /api reverse-proxy → the api container), so the language
# switcher actually switches. ponytail: `--no-fund --loglevel=error` silences npm 11 noise.
command: sh -c "npm ci --no-fund --loglevel=error && npx ng build --localize && node scripts/serve-i18n.mjs"
command: sh -c "npm ci --no-fund --loglevel=error && npx ng build --configuration development --localize && node scripts/serve-i18n.mjs"
environment:
- PORT=4200
- API_PROXY_TARGET=http://api:5000