Parameters
Properties passed to the Form.useTranslation hook.
| Type | Description | |
|---|---|---|
messages | FormsTranslation Record<locale, FormsTranslation> | (optional) Custom translation messages to merge with built-in forms translations. Can be a flat object or locale-keyed object. |
fallbackLocale | string | (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.
| Type | Description | |
|---|---|---|
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. |
countries | Array<string> | (required) Array of country names in the current locale, for use in country selection components. |
Field | object | (required) Translation string object for Field.* components. Contains keys such as errorRequired, errorPattern, and component-specific labels, error messages, and placeholders. |
Section | object | (required) Translation string object for Form.Section components. |
Wizard | object | (required) Translation string object for Wizard components (step labels, navigation). |
Iterate | object | (required) Translation string object for Iterate components (add/remove buttons). |