I have USM-Registration.json file for english, german and which is file for translation React app.
USM-Registration.json
"ResponseError": {
"error": {
"already.exists": "Social security number already exists. Please login at {{link}}."
},
},
Note that I have {{link}} which will be dynamically provided but I have an issue with that.
I am using formik and validation with yup but I am unable to pass link as part of string, but when I provide string, works ok.
How to parse that link and display it properly?
import { useTranslation } from 'react-i18next'
const { t } = useTranslation()
...rest of the code...
ssn: string()
.test(
'ssn',
t(
'USM-Registration:ResponseError.error.already.exists',
'Social security number already exists. Please login at domain.com.',
{link: linkShouldBeHere}
),
function(value) {
return
},
),
To display an error , I am using error and helperText on input
error={!!form.errors.ssn}
helperText={form.errors.ssn}