This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
Remove fallback error message from recaptcha validator #93
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.
Hi,
As it's already discussed in #63, using the
trans
helper in the boot method causes the translations to load, and any json translation file path added after will be never loaded.While the workaround implemented in 5ceac2f can solve the issue if i set the
"empty_message"
config value to true, in my opinion it is totally unnecessary. Laravel validation uses the same error key by default, the provided message is just a fallback message.I've added some tests to verify the behaviour is the same without setting the fallback error message.
The documented way of customizing the error message remains the same: https://github.com/biscolab/laravel-recaptcha?tab=readme-ov-file#customize-error-message
Nonetheless it can be a breaking change for ppl who modified the
"error_message_key"
in the recaptcha config and they didn't set the message in the validation.php lang file. I think the preferred way should be to set the translation instead.