Improve validation messages for better readability and accessibility#2727
Improve validation messages for better readability and accessibility#2727lvarnavas wants to merge 18 commits into
Conversation
|
|
Lampros Varnavas seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Looks like a great improvement @movrack @lvarnavas 🙌 Maybe it's an idea to align:
So I think they will all work without mentioning "the field". On top, it might become more readable if we add quotes to the fieldName (which is by default the label). One potential problem is that fieldName can be prefilled in a way that is fitting in the current sentence. Not the end of the world, but we need to check usage of this to measure the impact. |
|
@tlouisse For the last remarks: I do think, it's to you to choose. We can't have both excepting adding complexity with other attribute/parameters enabling the quotes in the translation . Are you able to know how many are using the "fieldName" ? Else, can we know if we get the value form label or from fieldName ? In that case, we might add the quotes from the code based on that information ? |
It's not worth it indeed I agree (that complexity). I think the suggestion to drop the quotes could be acceptable in this case. We could deprecate that option as from an a11y perspective, the reference to the label is recognizable for the user.
You could write an Omniscient plugin, but I think a search for
Good idea. We could do something like: get fieldName() {
return this.__fieldName || `"${this.label}"` || this.name || '';
} |
This PR:
Updates validation messages to use clear sentences
Avoids mixed or condensed forms that can confuse users
Makes messages easier to read and understand across languages
Improves accessibility (A11Y), especially for users relying on screen readers
Related to #2724