Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration of LocaleAwareNumberField and DateTimeField with Flask-Babel #398

Open
weinbusch opened this issue Feb 12, 2020 · 0 comments · May be fixed by #399
Open

Integration of LocaleAwareNumberField and DateTimeField with Flask-Babel #398

weinbusch opened this issue Feb 12, 2020 · 0 comments · May be fixed by #399

Comments

@weinbusch
Copy link

weinbusch commented Feb 12, 2020

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?

@weinbusch weinbusch linked a pull request Feb 12, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant