diff --git a/messages/en.json b/messages/en.json index 76a96987e..f128039c2 100644 --- a/messages/en.json +++ b/messages/en.json @@ -10360,9 +10360,9 @@ "3": "Trouble falling or staying asleep, or sleeping too much", "4": "Feeling tired or having little energy", "5": "Poor appetite or overeating", - "6": "Feeling bad about yourself, or that you are a failure or have let yourself or your family down", + "6": "Feeling bad about yourself — or that you are a failure or have let yourself or your family down", "7": "Trouble concentrating on things, such as reading the newspaper or watching television", - "8": "Moving or speaking so slowly that other people could have noticed. Or the opposite: being so fidgety or restless that you have been moving around a lot more than usual", + "8": "Moving or speaking so slowly that other people could have noticed. Or the opposite — being so fidgety or restless that you have been moving around a lot more than usual", "9": "Thoughts that you would be better off dead, or of hurting yourself in some way" }, "gad7": { diff --git a/messages/fr.json b/messages/fr.json index 5e73cfb4a..6dee0c114 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -10360,7 +10360,7 @@ "3": "Difficultés à s'endormir ou à rester endormi(e), ou dormir trop", "4": "Se sentir fatigué(e) ou avoir peu d'énergie", "5": "Avoir peu d'appétit ou manger trop", - "6": "Avoir une mauvaise opinion de soi-même, ou avoir le sentiment d'être nul(le) ou d'avoir déçu sa famille ou soi-même", + "6": "Avoir une mauvaise opinion de soi-même — ou avoir le sentiment d'être nul(le) ou d'avoir déçu sa famille ou soi-même", "7": "Avoir du mal à se concentrer, par exemple pour lire le journal ou regarder la télévision", "8": "Bouger ou parler si lentement que les autres ont pu le remarquer. Ou au contraire, être si agité(e) que vous avez bougé beaucoup plus que d'habitude", "9": "Penser qu'il vaudrait mieux mourir ou envisager de vous faire du mal d'une manière ou d'une autre" diff --git a/messages/ko.json b/messages/ko.json index 627fb3d31..649bb7763 100644 --- a/messages/ko.json +++ b/messages/ko.json @@ -10360,7 +10360,7 @@ "3": "잠이 들거나 계속 잠을 자는 것이 어려움, 또는 잠을 너무 많이 잠", "4": "피곤하다고 느끼거나 기운이 거의 없음", "5": "입맛이 없거나 과식을 함", - "6": "자신을 부정적으로 봄, 혹은 자신이 실패자라고 느끼거나 자신 또는 가족을 실망시킴", + "6": "자신을 부정적으로 봄 — 혹은 자신이 실패자라고 느끼거나 자신 또는 가족을 실망시킴", "7": "신문을 읽거나 텔레비전 보는 것과 같은 일에 집중하는 것이 어려움", "8": "다른 사람들이 주목할 정도로 너무 느리게 움직이거나 말을 함. 또는 반대로 평상시보다 많이 움직여서, 너무 안절부절 못하거나 들떠 있음", "9": "자신이 죽는 것이 더 낫다고 생각하거나 어떤 식으로든 자신을 해칠 것이라고 생각함" diff --git a/messages/pl.json b/messages/pl.json index 00a3a665b..5ae6159a1 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -10360,9 +10360,9 @@ "3": "Kłopoty z zaśnięciem lub utrzymaniem snu albo zbyt długi sen", "4": "Uczucie zmęczenia lub brak energii", "5": "Brak apetytu lub przejadanie się", - "6": "Złe myślenie o sobie, poczucie, że jest się nieudacznikiem lub że zawiodło się siebie albo rodzinę", + "6": "Złe myślenie o sobie — poczucie, że jest się nieudacznikiem lub że zawiodło się siebie albo rodzinę", "7": "Trudności ze skupieniem się, na przykład podczas czytania gazety lub oglądania telewizji", - "8": "Poruszanie się lub mówienie tak wolno, że inni mogli to zauważyć? Albo przeciwnie: niepokój lub pobudzenie powodujące, że poruszasz się znacznie więcej niż zwykle", + "8": "Poruszanie się lub mówienie tak wolno, że inni mogli to zauważyć? Albo przeciwnie — niepokój lub pobudzenie powodujące, że poruszasz się znacznie więcej niż zwykle", "9": "Myśli, że lepiej byłoby umrzeć albo chęć zrobienia sobie w jakiś sposób krzywdy" }, "gad7": { diff --git a/src/__tests__/i18n-no-dot-separator.test.ts b/src/__tests__/i18n-no-dot-separator.test.ts index f464e6809..d315ec9c1 100644 --- a/src/__tests__/i18n-no-dot-separator.test.ts +++ b/src/__tests__/i18n-no-dot-separator.test.ts @@ -30,6 +30,20 @@ const hasSeparator = (value: string) => /** Key path -> why the separator is right there. Empty by intent. */ const ALLOWED: Record = {}; +/** + * Subtrees whose wording is not ours to change. The questionnaire items are + * the licensed, validated text of PHQ-9, GAD-7 and the other instruments in + * each language; a dash there is part of the instrument (PHQ-9 item 6 reads + * "Feeling bad about yourself — or that you are a failure ..."), and + * rewording it would change what the score measures. + */ +const EXEMPT_PREFIXES: Record = { + "mentalHealth.items.": "validated questionnaire wording, verbatim", +}; + +const isExempt = (key: string) => + Object.keys(EXEMPT_PREFIXES).some((prefix) => key.startsWith(prefix)); + function flatten( obj: unknown, prefix: string, @@ -66,7 +80,10 @@ describe("message bundles carry no ' · ', ' — ' or ' – ' separator", () => it(`${file} has no dot or dash separator outside the allowlist`, () => { const offenders = [...values] - .filter(([key, value]) => hasSeparator(value) && !(key in ALLOWED)) + .filter( + ([key, value]) => + hasSeparator(value) && !(key in ALLOWED) && !isExempt(key), + ) .map(([key, value]) => `${key} = ${JSON.stringify(value)}`); expect(offenders).toEqual([]); });