Refactor: let reCAPTCHA error messages use translation
What does this MR do and why?
Replace the hardcoded error messages with translation methods. #354071 (closed)
The code logic is simple that the reCAPTCHA error messages will be placed in the translation method _(ERROR_MESSAGE)
to make sure the messages can be overwritten.
Please see the sample code below:
Before
expect(flash[:alert]).to include 'There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.'
After
expect(flash[:alert]).to include _('There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.')
Screenshots or screen recordings
No changes on GitLab UI.
Here the error message we are going to implement in Jihu GitLab.
How to set up and validate locally
- Visit the snippets page like
https://gitlab.com/gitlab-org/gitlab/-/snippets
- Fill the title and content with
12321
- Click on submit
- The expectation is that the error message should NOT be changed on GitLab.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by ARCHIVED - Martin Tan