Skip to content

i18n(nl): add Dutch as an eighth end-to-end locale - #1246

Merged
MBombeck merged 1 commit into
MBombeck:mainfrom
robdegraaf:feat/i18n-nl
Oct 20, 2026
Merged

MBombeck merged 1 commit into
MBombeck:mainfrom
robdegraaf:feat/i18n-nl

Conversation

@robdegraaf

Copy link
Copy Markdown

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/jij throughout (the Dutch equivalent of the German du).

Bundle

  • messages/nl.json: full key parity with en.json (10,554 keys), all {placeholders} and markup preserved, none of the forbidden · / — / – separators.
  • The Telegram keyword taken stays untranslated (the bot only recognises taken / genommen).
  • SCI items, stems and anchors stay in English (validated in English only), as in every other locale.

Locale registration

src/lib/i18n/config.ts, load-locale.ts, shared-resolve.ts, format-locale.ts (nl-NL, Accept-Language), calendar-locale.ts (date-fns nl), vitest.setup.ts, the boot/key-tool/split scripts, every zod locale enum (record settings, managed profiles, medication extract, OpenAPI; docs/api/openapi.yaml regenerated), the isLocale guards 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), and outputLanguageDirective falls 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:

  • dose: change verbs with a target (verhoog … naar 2000 mg, verb-final infinitives … naar 5 mg te verlagen), take-an-amount imperatives, halve/double/pause, the separable sla … over, stop met (het innemen van), laat … weg, cue + infinitive (je zou de metformine kunnen stoppen), and the extra / nog een / … meer shapes. 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.
  • risk: percent/risk-noun pairs, spelled-out percents, the 10-year horizon, engine + number/result/band/verdict.
  • causal: omdat, doordat, vanwege, veroorzaakt, als gevolg van, leidt tot, komt door, dankzij, …
  • continuation / change-stem exemption tables.

Tests: Dutch fixtures in every per-locale table of outbound-screen.test.ts and outbound-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 (nooit is 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

nl is 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 in instruments.ts plus the test. AUDIT-C shows the English items (validatedLocale: false) with the Bradley cut-offs, like es/fr/it.

Guards

  • nl added to LEAK_LOCALES; seven Dutch keys that are legitimately identical to English ("In bed", "capsule(s)", GMI, J-index, DHA/EPA) added to LEGIT_IDENTICAL.
  • Every test that enumerates locales updated.
  • Translation issue template: Korean and Dutch added to the dropdown. README / CONTRIBUTING mention Dutch.

Not in this PR (follow-ups)

  • zxcvbn password-strength warnings stay English for nl (as for fr/es/it/pl).
  • No native safety-contracts.nl.yaml / native Coach prompt.
  • Verifying the Dutch PHQ-9 / GAD-7 / WHO-5 wording against the published forms.

Test plan

  • pnpm typecheck
  • pnpm lint (changed files)
  • pnpm test (full vitest run)
  • pnpm openapi:check
  • Manually: switch language to Nederlands in settings, check dashboard, calendar month names, banner.

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.
@robdegraaf

Copy link
Copy Markdown
Author

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!

@MBombeck MBombeck mentioned this pull request Oct 20, 2026
@MBombeck
MBombeck merged commit 7be3714 into MBombeck:main Oct 20, 2026
13 of 18 checks passed
@MBombeck

Copy link
Copy Markdown
Owner

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! 🍺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants