Dinesht04 opened a new issue, #1409:
URL: https://github.com/apache/answer/issues/1409

   ## Is your enhancement request related to a problem?
   No, not a problem. But I think it is a required enhancement.
   When the validation of an input fails in the back-end. The error message 
includes the 'key' of the value.
   For Eg: For Minimum Question Body Length, the error message includes 
"min_content"
   Many other examples in the picture linked below
   
   <img width="520" height="507" alt="Image" 
src="https://github.com/user-attachments/assets/7e6f63ba-1395-4d97-a9c1-f9e483ebf3f6";
 />
   
   ## Describe the solution you'd like
   
   I checked into this and validator library sends the message directly.
   Since the key_name is necessary for debugging in back-end, maybe we can add 
a utility function in the front-end where it replaces the key of the value with 
the label for the field. 
   
   The draft vision for the function that I have right now is :-
   The first word for every error message contains the key name. So we extract 
the first word, small case the first letter, then match it for it's label in 
the translations files.  
   
   ## Describe alternatives you've considered
   
   An easier approach would be to just remove the first word from the error 
message since the placement of the error message gives enough context about 
which field is failing the validation and the keys that we are rendering right 
now might as well be redundant.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to