flask-wtf
flask-wtf copied to clipboard
i18n to RECAPTCHA_ERROR_CODES
It will be helpful if these messages could be translated without modify locally this file:
flask_wtf/recaptcha/validators.py
RECAPTCHA_ERROR_CODES = { 'missing-input-secret': 'The secret parameter is missing.', 'invalid-input-secret': 'The secret parameter is invalid or malformed.', 'missing-input-response': 'The response parameter is missing.', 'invalid-input-response': 'The response parameter is invalid or malformed.' }
I can make a PR, just fixed it for myself.
@sobolevn that would be great. I was trying to, but I'm not very familiar with i18n. :confounded: If you come across any other strings that need to be translatable, go ahead and mark them as well if you want.
Any plans to support https://www.transifex.com/ ?
I don't think we have the resources for transifex/crowdin/etc. Or does support not involve buying a plan? That would be a separate issue though.
I'd imagine this would just be slurping in some localized JSON blob in a constructor (e.g. validators_en.json, validators_ru.json) -- 3rd party stuff seems like overkill.
I have done it using babel
. I have used the same approach as wtform
. Is it fine by everyone?
I guess I will be able to submit it for review pretty soon.
Sorry, forgot to mention this issue: https://github.com/lepture/flask-wtf/pull/253
An approach such as https://github.com/wtforms/wtforms/tree/master/src/wtforms/locale is welcome.
I don't think we have the resources for transifex/crowdin/etc. Or does support not involve buying a plan? That would be a separate issue though.
Weblate is free for FOSS. See the Libre plan at the bottom of https://weblate.org/en/hosting/ and use the same account for all repos under wtforms organization.