Changelog - 2026-11-04
useUntypedTranslate translates a key that exists only at run time
New FeatureIn one line. useUntypedTranslate() returns translate(key: string, options?), for a key the compiler cannot know, such as errors.${code} or status.${row.status}. useTranslate is unchanged: it still accepts only the keys of the catalog and the keys you add by augmentation.
The example is in useUntypedTranslate.
What changed
- A second hook, next to the typed one. Both read the same i18n provider, so they share the catalogs, the locale and the lazy sources. They are one function, ra-core's
useTranslate:useTranslateisuseUntypedTranslatewith the key narrowed toTUseTranslateKeys, so they cannot drift. - Same behavior for a missing key and a missing provider. A key the catalogs do not hold comes back unchanged, or as the
_text of the options. With no i18n provider, ra-core's default provider answers the same way and fills%{token}placeholders from the options. - Also in
Ardor.Ardor.useUntypedTranslatejoins the namespace, andardor codemod namespace --hooksknows it. - A new type.
TUseUntypedTranslateFnis the function the hook returns.
Who is affected
- An app that casts a run-time key to
TUseTranslateKeys, or wraps thera-corehook itself. You can useuseUntypedTranslateinstead and remove the cast or the wrapper. - All other apps. No action needed.
See Hooks and Internationalization.