diff --git a/prisma/schema.prisma b/prisma/schema.prisma index ca42d421f..f62e1a639 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -5226,7 +5226,8 @@ model InsightNarrative { userId String @map("user_id") /// "week" | "month". period String - /// Resolved UI locale of the prose ("de" | "en"). + /// Resolved UI locale of the prose — any shipped UI locale, not just de/en: + /// the prose is generated per locale, so the row is keyed by it. locale String /// UTC YYYY-MM-DD boundary the narrative was generated for. dateKey String @map("date_key") diff --git a/src/lib/ai/coach/facts.ts b/src/lib/ai/coach/facts.ts index c210823f1..265598d64 100644 --- a/src/lib/ai/coach/facts.ts +++ b/src/lib/ai/coach/facts.ts @@ -558,7 +558,10 @@ function deterministicFactText( subject: string, locale: string | undefined, ): string { - const de = locale?.toLowerCase().startsWith("de") ?? true; + // German only for a German reader; every other locale — and an absent one — + // composes ENGLISH. The fact text is model-facing memory, so English is the + // fallback body; the previous `?? true` made an unknown locale German. + const de = locale?.toLowerCase().startsWith("de") ?? false; switch (kind) { case "allergy": return de