also translate the message (#30654)
fixes: #29098 Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
parent
e3649eb86a
commit
a8aa410ad3
1 changed files with 8 additions and 5 deletions
|
@ -67,13 +67,16 @@ export function setUserProfileServerError<T>(
|
|||
).forEach((e) => {
|
||||
const params = Object.assign(
|
||||
{},
|
||||
e.params?.map((p) => t(isBundleKey(p.toString()) ? unWrap(p) : p)),
|
||||
e.params?.map((p) => (isBundleKey(p.toString()) ? t(unWrap(p)) : p)),
|
||||
);
|
||||
setError(fieldName(e.field) as keyof T, {
|
||||
message: t(e.errorMessage, {
|
||||
message: t(
|
||||
isBundleKey(e.errorMessage) ? unWrap(e.errorMessage) : e.errorMessage,
|
||||
{
|
||||
...params,
|
||||
defaultValue: e.errorMessage || e.field,
|
||||
}),
|
||||
},
|
||||
),
|
||||
type: "server",
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue