You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Messages inside the global form validation function are now displayed without translation:
constvalidateUserCreation=(values)=>{consterrors={};if(!values.firstName){errors.firstName='The firstName is required';}if(!values.age){// You can return translation keyserrors.age='ra.validation.required';// The message is displayed without translation!}elseif(values.age<18){// Or an object if the translation messages need parameterserrors.age={message: 'ra.validation.minValue',// The message is displayed without translation!args: {min: 18}};}returnerrors};exportconstUserCreate=()=>(<Create><Formvalidate={validateUserCreation}><TextInputlabel="First Name"source="firstName"/><TextInputlabel="Age"source="age"/></Form></Create>);
React-admin version: 4.8.3
Last version that did not exhibit the issue (if applicable): ~4.8.2
React version: 18.2.0
Browser: Chrome 111.0.5563.65
The text was updated successfully, but these errors were encountered:
You are both right @MaxAlex666 and @fzaninotto
I created a story and added unit tests in #8746 so that we don't run into this issue anymore.
Thanks for the report!
Messages inside the global form validation function are now displayed without translation:
React-admin version: 4.8.3
Last version that did not exhibit the issue (if applicable): ~4.8.2
React version: 18.2.0
Browser: Chrome 111.0.5563.65
The text was updated successfully, but these errors were encountered: