I am trying to change the error message when the user forget to check the recaptcha checkbox. Even after set the language to pt, I am still receiving this message: The response parameter is missing.
from flask.ext.wtf import Form, RecaptchaField
recaptcha = RecaptchaField()
RECAPTCHA_PUBLIC_KEY = 'yyyy'
RECAPTCHA_PRIVATE_KEY = 'xxxx'
RECAPTCHA_PARAMETERS = {'hl': 'pt'}
-Language code from here
-Flask docs1 docs2 about recpacha
How can i change the language of these messages?
EDIT: Even after the upgrade to the last version of flask-wtforms, the error messages still are always in English. Only the labels change.
Relevant source code
I don't think it's possible with their current implementation:
https://github.com/lepture/flask-wtf/blob/8879e9827b0160776031bd06ef083b81282904e5/flask_wtf/recaptcha/widgets.py#L8
They have hardcoded URL to the library: https://www.google.com/recaptcha/api.js
But for different language settings there should be GET parameter passed in the recaptcha URL, for example: https://www.google.com/recaptcha/api.js?hl=ru
I've had to overwrite the field and validation manually for using different language settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With