Open ZehuaZhang opened 4 months ago
I have the same issue
const PasswordFormSchemaGen = (
t: ReturnType<typeof useTranslations<"error">>,
) =>
z
.object({
[InputNames.oldPassword]: z.string().regex(passwordValidation, {
message: t("password_8_upper_special"),
}),
[InputNames.newPassword]: z.string().regex(passwordValidation, {
message: t("password_8_upper_special"),
}),
[InputNames.cNewPassword]: z.string().regex(passwordValidation, {
message: t("password_8_upper_special"),
}),
})
.refine(
(data) => data[InputNames.newPassword] === data[InputNames.cNewPassword],
{
path: [InputNames.cNewPassword],
message: t("password_does_match"),
},
)
.refine(
(data) => data[InputNames.oldPassword] === data[InputNames.newPassword],
{
path: [InputNames.newPassword],
message: t("can_not use_prev"),
},
);
Same issue, using react-i18next
Using
next-intl
,t = useTranslation('key')
, passingt
to a helper functiontypescript definition is working, but extension shows this local key name not found, and didn't show preview text.