Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vencelkatai
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant