mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-07 04:12:04 +00:00
The PHQ-9, GAD-7, WHO-5 and SCI now have text in every app language instead of falling back to the English original. Each instrument and language is one file under src/lib/mental-health/wording/ that declares what it is: a published validated translation reproduced word for word, with its source and terms in `source`, or a translation written for HealthLog, faithful to the English and on the same scale. Validated versions added: the Pfizer PHQ-9 for France, the Netherlands, Korea and Brazil, the Pfizer GAD-7 for the Netherlands, Korea and Brazil, the PRU Dutch WHO-5, the Korean WHO-5 validation (J Korean Geriatr Psychiatry 2010) and the Polish SCI validation (Sci Rep 2026). The SCI in the other languages and the WHO-5 in Brazilian Portuguese carry HealthLog's own translation; each file names any validated version found and why it is not used. Where the text is unvalidated, the check-in shows a note that the result is orientation and a one-tap switch to the English original. Each language loads as its own chunk when a questionnaire surface needs it. The item text, answers, stems and the PHQ-9 follow-up leave every message bundle, so a translator never sees them; the i18n guard now requires that no bundle carries them, and the registry test requires every instrument in every language with the item count and anchor scores the scoring expects. CONTRIBUTING explains where the wording lives and how to propose a validated version.
16 lines
698 B
TypeScript
16 lines
698 B
TypeScript
/**
|
|
* Query keys — opt-in mental-health screeners (PHQ-9 / GAD-7).
|
|
* Part of the centralized factory; aggregated in `./index.ts`.
|
|
*/
|
|
export const mentalHealthKeys = {
|
|
/** The caller's screener history, optionally filtered by instrument. */
|
|
mentalHealthAssessments: (instrument?: string) =>
|
|
["mental-health-assessments", instrument ?? null] as const,
|
|
/** One administration with its decrypted per-item answers. */
|
|
mentalHealthAssessmentDetail: (id: string) =>
|
|
["mental-health-assessment-detail", id] as const,
|
|
/** Every questionnaire's text in one app language (a static chunk). */
|
|
mentalHealthWording: (locale: string) =>
|
|
["mental-health-wording", locale] as const,
|
|
};
|