Translation files: the form messages of the cms-client package come from nl.json

Block cmsClient.contact holds the field errors, fallback, waiting time (one
and other), too-large, captcha-required, failure and sending label.
src/i18n/cmsClientMessages.ts builds the ContactMessages object for
useContactForm; a test checks that it says the same as the package's own
Dutch defaults, which stay as the fallback.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 00:30:01 +01:00
co-authored by Claude Sonnet 5.5
parent 85370351d0
commit e7bae5edd7
6 changed files with 96 additions and 2 deletions
@@ -25,6 +25,7 @@ import {
import { contactClient } from '@/contact/contactClient';
import type { EmailAddress } from '@/content/types';
import useEmailAddress from '@/hooks/useEmailAddress';
import { contactMessages } from '@/i18n/cmsClientMessages';
import { t } from '@/i18n';
import { mailtoLink } from '@/lib/mailLink';
import { trackContactEvent } from '@/lib/trackEvent';
@@ -108,6 +109,8 @@ export default function ContactForm({
token,
refreshToken,
fallbackAddress: address ?? '',
// The texts of the form come from the language file
messages: contactMessages,
onEvent: (event) =>
trackContactEvent(
event === 'sent' ? 'contact-sent' : 'contact-failed',