mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 22:26:13 +00:00
Largest feature delta in the v1.4.x line. Insights expands into seven dedicated metric sub-pages; GLP-1 medication tracking lands end-to-end (drug-level chart with Research Mode acknowledgment, EMA titration ladder, cadence + compliance, side-effect taxonomy, pen/vial inventory); cross-source priority becomes a two-axis resolver; per-user timezone threads through ten analytics surfaces; Withings activity + sleep v2 sync; onboarding rebuilt as a nested-route wizard; Personal Records ship end-to-end; Health Score provenance accordion; Coach runs native first-party prompts across six locales with a 1800-assertion refusal-probe matrix; OpenAPI drift gate hard-fails; multi-arch GHCR image. Migrations 0043 through 0060 are additive and forward-only. PROMPT_VERSION 4.24.0 → 4.25.0 with GROUND RULE 9 (refuses dose recommendations) and GROUND RULE 15 (refuses drug-level estimates with MDR + MDCG 2021-24 cites). See CHANGELOG.md for the full per-section delta.
78 lines
4.8 KiB
TypeScript
78 lines
4.8 KiB
TypeScript
import type { Locale } from "@/lib/i18n/config";
|
|
|
|
/**
|
|
* v1.4.25 W9e — these no-key fallbacks ship DE + EN bodies only. The
|
|
* type accepts every shipped locale (fr/es/it/pl too) and routes
|
|
* non-DE locales through the EN body, mirroring the same fallback
|
|
* chain the JSON message bundles use. When DE/EN-only fallbacks get
|
|
* replaced with proper FR/ES/IT/PL bodies, expand `getLocalizedText`
|
|
* to read the matching argument.
|
|
*/
|
|
export type InsightLocale = Locale;
|
|
|
|
function getLocalizedText(
|
|
locale: InsightLocale,
|
|
de: string,
|
|
en: string,
|
|
): string {
|
|
return locale === "de" ? de : en;
|
|
}
|
|
|
|
export function getNoKeyGeneralStatusText(locale: InsightLocale): string {
|
|
return getLocalizedText(
|
|
locale,
|
|
"Beobachte Entwicklungen über mehrere Wochen statt einzelne Tageswerte isoliert zu bewerten. Achte auf konsistente Messzeitpunkte, damit Trends belastbar vergleichbar bleiben. Reagiere früh, wenn sich mehrere Kennzahlen gleichzeitig in eine ungünstige Richtung bewegen.",
|
|
"Track developments over several weeks instead of judging single daily values in isolation. Keep measurement timing consistent so trends remain comparable and reliable. React early when multiple metrics move in an unfavorable direction at the same time.",
|
|
);
|
|
}
|
|
|
|
export function getNoKeyBloodPressureStatusText(locale: InsightLocale): string {
|
|
return getLocalizedText(
|
|
locale,
|
|
"Miss den Blutdruck möglichst in Ruhe und unter vergleichbaren Bedingungen. Entscheidend ist die Tendenz über mehrere Tage, nicht ein einzelner Ausreißer. Beurteile systolische und diastolische Werte immer gemeinsam im zeitlichen Verlauf.",
|
|
"Measure blood pressure at rest and under comparable conditions whenever possible. The multi-day trend matters more than a single outlier. Always evaluate systolic and diastolic values together over time.",
|
|
);
|
|
}
|
|
|
|
export function getNoKeyWeightStatusText(locale: InsightLocale): string {
|
|
return getLocalizedText(
|
|
locale,
|
|
"Bewerte Gewicht vor allem im Verlauf und nicht anhand einzelner Tage. Nutze möglichst konstante Messbedingungen, um normale Schwankungen besser einzuordnen. Wichtig ist die langfristige Richtung im Zusammenspiel mit Blutdruck und BMI.",
|
|
"Evaluate weight mainly as a trend rather than by isolated daily readings. Use consistent measurement conditions to interpret normal fluctuations more reliably. What matters most is the long-term direction together with blood pressure and BMI.",
|
|
);
|
|
}
|
|
|
|
export function getNoKeyPulseStatusText(locale: InsightLocale): string {
|
|
return getLocalizedText(
|
|
locale,
|
|
"Miss den Ruhepuls in einer entspannten Situation und möglichst zur gleichen Tageszeit. Kurzfristige Ausschläge sind normal, wichtiger ist die Entwicklung über mehrere Tage. Achte auf wiederkehrende Abweichungen vom persönlichen Zielbereich.",
|
|
"Measure resting pulse in a relaxed state and ideally at the same time of day. Short-term spikes are normal, while the multi-day pattern is more important. Watch for repeated deviations from your personal target range.",
|
|
);
|
|
}
|
|
|
|
export function getNoKeyBmiStatusText(locale: InsightLocale): string {
|
|
return getLocalizedText(
|
|
locale,
|
|
"Der BMI ist eine Orientierungsgröße und sollte immer zusammen mit Gewichtstrend und Körperfett betrachtet werden. Einzelwerte sind weniger wichtig als die Entwicklung über Wochen. Aussagekräftig sind vor allem stabile Verbesserungen oder dauerhafte Abweichungen.",
|
|
"BMI is a directional metric and should always be viewed together with weight trend and body-fat context. Single values are less important than changes across weeks. The most meaningful signals are sustained improvements or persistent deviations.",
|
|
);
|
|
}
|
|
|
|
export function getNoKeyMedicationComplianceStatusText(
|
|
locale: InsightLocale,
|
|
): string {
|
|
return getLocalizedText(
|
|
locale,
|
|
"Konstanz bei der Einnahme ist wichtiger als einzelne perfekte Tage. Beurteile die Treue pro Medikament und zusätzlich im Gesamtbild über mehrere Wochen. Achte besonders auf wiederkehrende Auslassungen und stabilisiere dafür feste Zeitfenster-Routinen.",
|
|
"Consistency in intake matters more than isolated perfect days. Evaluate adherence per medication and also in the overall multi-week picture. Pay special attention to repeated misses and stabilize fixed time-window routines.",
|
|
);
|
|
}
|
|
|
|
export function getNoKeyMoodStatusText(locale: InsightLocale): string {
|
|
return getLocalizedText(
|
|
locale,
|
|
"Bewerte die Stimmung im Verlauf über mehrere Wochen statt einzelne Tage isoliert zu betrachten. Achte auf wiederkehrende Muster und Zusammenhänge mit anderen Gesundheitswerten. Anhaltende Phasen niedriger Stimmung verdienen besondere Aufmerksamkeit.",
|
|
"Evaluate mood trends over several weeks rather than isolated daily readings. Watch for recurring patterns and correlations with other health metrics. Sustained periods of low mood deserve special attention.",
|
|
);
|
|
}
|