Skip to content

Parameters

Properties passed to the Form.useTranslation hook.

TypeDescription
messagesFormsTranslation
Record<locale, FormsTranslation>
(optional) Custom translation messages to merge with built-in forms translations. Can be a flat object or locale-keyed object.
fallbackLocalestring(optional) Locale to use when translations are missing in the current locale. Defaults to "nb-NO".

Return Values

Properties and methods returned from the Form.useTranslation hook.

TypeDescription
formatMessage(id: string, values?: Record<string, unknown>) => string(required) Formats a translation key with ICU MessageFormat syntax. Supports pluralization, select, and variable interpolation.
renderMessage(id: string, values?: Record<string, React.ReactNode>) => React.ReactNode(required) Like formatMessage but returns React.ReactNode, allowing React elements in interpolated values.
countriesArray<string>(required) Array of country names in the current locale, for use in country selection components.
Fieldobject(required) Translation string object for Field.* components. Contains keys such as errorRequired, errorPattern, and component-specific labels, error messages, and placeholders.
Sectionobject(required) Translation string object for Form.Section components.
Wizardobject(required) Translation string object for Wizard components (step labels, navigation).
Iterateobject(required) Translation string object for Iterate components (add/remove buttons).