French localization via next-intl, with Mistral LLM and legal-source toggles bundled in

davidchtchian adds `next-intl` ^3.26.3 with an `en`/`de`/`fr` locale system across two commits - but the second commit, despite carrying the same "Französisch hinzugefügt" message, also ships a full Mistral provider and two new chat UI toggles. Useful if you need any of those three things; hazardous if you only want one.

i18nchat-ui

The first commit (c52bd7e) adds the next-intl scaffolding: i18n.ts defining locales = ['en','de','fr'], a middleware.ts, a LanguageSwitcher component, and three message JSON files covering nav, common, auth, and language namespaces (~44 keys each). providers.tsx gets wrapped in NextIntlClientProvider; the root layout becomes async to read params.locale and call getMessages(). The problem: there is no [locale] route segment yet at this point, so commit 1 in isolation does not compile to a working app.

Commit 2 (730c7524) fixes that by moving all routes under frontend/src/app/[locale]/ - the canonical next-intl App Router pattern. It adds [locale]/layout.tsx and [locale]/error.tsx, reverts the root layout back to non-async with a hardcoded lang="en", and patches the middleware matcher to ['/((?!api|_next|_vercel|.*\\..*).*)']. One hardcoded push in ApiKeyMissingModal.tsx gets prefixed with /${locale}. The translation coverage is thin: actual page content is not translated, and [locale]/error.tsx still has "Something went wrong" in English.

Commit 2 also contains two unrelated features. A 164-line backend/src/lib/mistral.ts adds streaming and non-streaming completions via the Mistral API (https://api.mistral.ai/v1/chat/completions), wired into llm/index.ts and a new "Mistral" model group in the frontend. The streaming function has a structural defect visible in the diff - the for loop body appears to close before completeMistralText is defined, and there is no explicit return in the iteration path; verify the compiled output before using it. Separately, ChatInput.tsx gains legalSourcesEnabled and citationStyle: "default" | "azr" toggles, threaded into the submit payload and MikeMessage in shared/types.ts. That types.ts edit introduces a stray } that closes the interface prematurely, which will not compile.

If you cherry-pick for i18n only, take both commits or neither - commit 1 is broken without commit 2. Filter out the Mistral and toggle changes from commit 2 before applying.

So what Worth a look if you want a working next-intl route structure to copy - the `[locale]` segment layout is correct. Skip if you want production-ready Mistral integration or the legal-source toggles; both have compile errors in the diff. The French message catalog is a starting point only; most content strings are still English.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

2 commits from davidchtchian/ami, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
c52bd7e7 Französisch hinzugefügt David 2026-05-09 ↗ GitHub
730c7524 Französisch hinzugefügt David 2026-05-09 ↗ GitHub

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-224.md from inside the repo you want the changes in.

⬇ Download capture-thread-224.md