VA Forms System Core will be a React library hosted in NPM that will allow engineers and designers to easily interact with Forms inside of vets-website.
According to our documentation, all error messaging should be internationalized. By default, error messages are generated in src/utils/validation.ts and are not translated. To improve accessibility, the default error messages should be placed in a translations file like src/messages/en.ts.
Potential solution
Add a variable to the string inside the translations file:
default: '{{ label }} is required',
And then modify the getMessage function from i18n to accept a second argument that's an object of template values.
Acceptance Criteria
[ ] Ensure that the default error messages are prepared for internationalization
[ ] Ensure all other hardcoded error strings are moved into the translation file, like from SSNField, EmailField, and DateField
Description
According to our documentation, all error messaging should be internationalized. By default, error messages are generated in
src/utils/validation.ts
and are not translated. To improve accessibility, the default error messages should be placed in a translations file likesrc/messages/en.ts
.Potential solution
Add a variable to the string inside the translations file:
And then modify the
getMessage
function fromi18n
to accept a second argument that's an object of template values.Acceptance Criteria