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 offers the option to localize output of LocaleAwareNumberField based on the form.meta.locales attribute. Similary, DateTimeField accepts a format keyword argument for printing dates and times.
It would be nice to integrate these settings with flask_babel. I am aware that these fields are defined in wtforms and not in flask-wtf, but I believe that flask-wtf should be the place for integration with flask_babel. Currently, flask-wtf uses flask_babel.get_locale through the i18n.py module to get the current locale and to provide translations based on the locale.
Does anybody have an idea how get_locale could be used to provide automatic formatting to LocaleAwareNumberField and DateTimeField?
The text was updated successfully, but these errors were encountered:
wtforms
offers the option to localize output ofLocaleAwareNumberField
based on theform.meta.locales
attribute. Similary,DateTimeField
accepts aformat
keyword argument for printing dates and times.It would be nice to integrate these settings with
flask_babel
. I am aware that these fields are defined inwtforms
and not inflask-wtf
, but I believe thatflask-wtf
should be the place for integration withflask_babel
. Currently,flask-wtf
usesflask_babel.get_locale
through thei18n.py
module to get the current locale and to provide translations based on the locale.Does anybody have an idea how
get_locale
could be used to provide automatic formatting toLocaleAwareNumberField
andDateTimeField
?The text was updated successfully, but these errors were encountered: