Like what we’re doing? Star us on GitHub!

How to translate validation error messages

4 weeks ago

I tried following the documentation

Validation function has translation function as an optional param, but when I use the same translation function, the error message still does not translate.

I have not extended i18 configuration. I am just using the


function and expecting payload to translate according to the language chosen by the user. Is there anything that I am missing.

validate: (value, { t }) => { if (condition) return true; return t( "The URL must start with xyz" ); }
Open the post
Continue the discussion in Discord
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More