-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Standardizing validation messages #31788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I understand what you propose, but I fear this might be a too large BC break: this would invalidate any existing alternative translations. I don't know how/if we can do this. |
Thanks for the feedback @nicolas-grekas. What I'm seeing that could be done to avoid BC issues is: That way, translations on all languages are kept as-is – so they're conveying pretty much the same understandable message – but from then on developers might provide more precise translations at any point to be in sync with the standard. I've tried to illustrate this using a simple example which can be seen in this gist. Also, messages that are not in sync with the standard could be deprecated and removed at some point in the future, where breaking changes are allowed and clearly communicated. What do you think? |
I like this pull request. Having consistent error messages sounds like a nice goal. 👍 for me |
@fabpot which forward path do you recommend? Should we go with identifiers instead of messages as source? |
we should leverage #30931 imho, and get this right in one version :) i.e. define |
Would it make sense to try to translate all the new messages during SymfonyCon Amsterdam where we have a lot of different countries/languages represented? If we can have enough people, that could work. |
Thank you for proposing. The proposed messages are marginally better, but the effort to migrate to using is not worth the effort. |
Currently, almost all of the validation messages follow the same format, which I personally like.
Some of the examples are:
Basically, the format is: reference the subject ("this value", "this collection", "the file"...) and then explain what the actual problem is.
There are two exceptions that I'm seeing:
This PR fixes this in a way so that the messages which have been addressing anyone no longer do. Examples:
This PR fixes that in a way that so that the messages conform to the same format as most of the others (referencing the subject and then stating the problem). Examples:
Also, as an added bonus, since I'm Croatian, I've done the translations for Croatian language in the very same PR + fixed some of the messages that didn't account for Croatian pluralization rules (or have, but implemented incorrectly).
All comments and feedback are appreciated.
Have a nice day!