0

it's been 3 hours since I started trying to get a nested translation and I'm stuck. I have this structure in common.json

"forms": {
  "fields": {
    "rea_number": "",
    "ateco_number": "",
    "commercial_register_number": "",
    ...
  }
}

which I would like to use in combination with Antd Form validateMessages, in this case string.min. I wanted to have a common error message if the field value is shorter than 4 characters with this translation

"min_length": "$t(common:forms.fields.{{name}}, {\"name\": ${name}}) deve essere lungo almeno ${min} caratteri"

It prints "forms.fields.,{"name". residence_zip_code} deve essere lungo almeno 4 caratteri" I know I could use interpolation but the field list is massive and I won't add options for every field.

Thank you!

Oscopoldo
  • 51
  • 4

0 Answers0