Repository navigation
i18n(nl): add Dutch as an eighth end-to-end locale - #1246
Conversation
Adds messages/nl.json (AI-initial, informal je/jij register, full key parity with en.json) and registers nl everywhere the locale list lives: config, loaders, Intl/date-fns mapping, zod enums, OpenAPI spec, scripts, the managed-profile picker and the notification locale guards. Dutch follows the Korean pattern for the AI surfaces (English body plus a Dutch reply-language footer, no safety-contract matrix) and gets its own banks in the outbound safety screen (dose, risk, causal, continuation), the prose-grounding and citation-coverage tables, the reference-range prose and the no-key fallback copy, each with Dutch test fixtures. PHQ-9 / GAD-7 / WHO-5 are not marked validated for nl yet: the Dutch wording has not been read against the published forms, so Dutch readers get the English items plus the existing note until it has.
|
A personal note on this PR: I created this PR with Claude Code (Opus 5.5). I'm a native Dutch speaker and I'll be using HealthLog in Dutch myself from now on. I've done a general scan of the translation for correctness. Whenever I come across words or phrases in daily use that could have been translated better, I'll submit follow-up PRs to improve them. Thanks for building HealthLog and for making it easy to add a new language! |
|
Merged and released in v1.43.7. Thank you so much, @robdegraaf! 🇳🇱 Dutch is now the eighth language in HealthLog, and it is great to know that someone who will use it every day stands behind the translation. I added the handful of strings that landed after you drafted the catalogue, so Dutch is complete as of this release. If anything reads off once you use it day to day, a follow-up PR is very welcome. Friends in the Netherlands are always welcome here. Cheers with a Grolsch! 🍺 |
Summary
Adds Dutch (
nl) as an eighth end-to-end locale, in the AI-initial, community-maintained tier (the maintainership banner shows for it, as for fr/es/it/pl/ko).This is an AI-initial pass, not a line-by-line human review. Register is informal
je/jijthroughout (the Dutch equivalent of the Germandu).Bundle
messages/nl.json: full key parity withen.json(10,554 keys), all{placeholders}and markup preserved, none of the forbidden·/—/–separators.takenstays untranslated (the bot only recognisestaken/genommen).Locale registration
src/lib/i18n/config.ts,load-locale.ts,shared-resolve.ts,format-locale.ts(nl-NL, Accept-Language),calendar-locale.ts(date-fnsnl),vitest.setup.ts, the boot/key-tool/split scripts, every zod locale enum (record settings, managed profiles, medication extract, OpenAPI;docs/api/openapi.yamlregenerated), theisLocaleguards in the notification/login-alert paths, the managed-profile locale picker, country labels.AI surfaces
Dutch follows the Korean pattern: there is no
safety-contracts.nl.yaml, so the Coach and insights prompts use the English body plus a Dutch reply-language footer (informal register), andoutputLanguageDirectivefalls back to "Write your reply in Dutch."Outbound safety screen (
outbound-screen.ts)A Dutch bank for every contract, modelled on the German and Polish banks:
verhoog … naar 2000 mg, verb-final infinitives… naar 5 mg te verlagen), take-an-amount imperatives, halve/double/pause, the separablesla … over,stop met (het innemen van),laat … weg, cue + infinitive (je zou de metformine kunnen stoppen), and the extra /nog een/… meershapes. Past participles (verhoogd) are log restatements and do not match. Dutch medication nouns and drug-class words (bloedverdunner,bètablokker,plastablet, …),eenheden,druppels, spelled counts.omdat,doordat,vanwege,veroorzaakt,als gevolg van,leidt tot,komt door,dankzij, …Tests: Dutch fixtures in every per-locale table of
outbound-screen.test.tsandoutbound-screen-named-meds.test.ts(41 Dutch cases, violations and clean sentences).Known residual: because the EN bank always runs too, a Dutch warning that opens with the English-looking imperative "Stop nooit met metformine …" is blocked by the EN
stop … <drug>pattern (nooitis not an English stop word). This fails safe; I left the EN bank untouched.Other per-locale tables
Population-norm framing and Dutch month names (
coach-prose-grounding.ts), normative keywords (citation-coverage.ts), reference-range prose (parse-reference-range.ts), the no-AI-key fallback copy (no-key-fallbacks.ts), the AUDIT-C standard-drink note.Mental-health instruments
nlis deliberately not in the validated-item locales for PHQ-9, GAD-7 and WHO-5 yet. The bundle carries a Dutch wording intended to follow the published Dutch versions, but it has not been read against those forms, so Dutch readers get the English items plus the existing honest note until someone verifies it. Flipping it is a one-line change ininstruments.tsplus the test. AUDIT-C shows the English items (validatedLocale: false) with the Bradley cut-offs, like es/fr/it.Guards
nladded toLEAK_LOCALES; seven Dutch keys that are legitimately identical to English ("In bed", "capsule(s)", GMI, J-index, DHA/EPA) added toLEGIT_IDENTICAL.Not in this PR (follow-ups)
safety-contracts.nl.yaml/ native Coach prompt.Test plan
pnpm typecheckpnpm lint(changed files)pnpm test(full vitest run)pnpm openapi:check