You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wtforms has no hard dependency to babel/flask-babel, and translations work out of the box when properly configured, e.g. Form(flask.request.form, meta={"locales": ["fr"]})
However translations for a simple flask-wtf form with the same configuration won't work, unless flask-babel is installed and initialized.
This behavior feels unexpected, and adds an unnecessary dependency against flask-babel for non-English applications.
This can be fixed by manually setting WTF_I18N_ENABLED to False. Maybe WTF_I18N_ENABLED should default to True only if flask-babel is installed and False otherwise?
wtforms has no hard dependency to babel/flask-babel, and translations work out of the box when properly configured, e.g.
Form(flask.request.form, meta={"locales": ["fr"]})
However translations for a simple flask-wtf form with the same configuration won't work, unless flask-babel is installed and initialized.
This behavior feels unexpected, and adds an unnecessary dependency against flask-babel for non-English applications.
This can be fixed by manually setting
WTF_I18N_ENABLED
toFalse
. MaybeWTF_I18N_ENABLED
should default toTrue
only if flask-babel is installed andFalse
otherwise?vanilla wtforms
assertions pass
flask-wtf without flask-babel
assertions fail
flask-wtf with flask-babel
assertions pass
The text was updated successfully, but these errors were encountered: