Add value and details to i18n available interpolations #211
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The default errors include helpful information in the errors key. For instance a Minimum validation like
might include
In the
detailed
error return.Unfortunately - the values used to produce this string are not all available in the translation layer.
For keywords that produce error messages, the "default" error message is defined in the class itself - where it has access to the keywords
value
property anddetails
passed into theerror
method. Several of the default errors take advantage of these variables to expose richer error information.In order to produce error messages of the same informativeness as the "default" message while taking advantage of the I18n layer - this PR exposes the
value
anddetails
property of the keyword object that is already in scope when i18n is called - this allows us to for instance translate the above error in the PigLatin locale to:using i18n - rather than being limited to