From 12b4b835427962c23546a4a7aff064d0bb03b12d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Fri, 24 Jul 2020 19:33:38 +0200 Subject: Revert "Remove translation hack" This reverts commit 6600ae0674bc685c4756a040b4db47e927f2e15e. --- kosten/app/forms.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kosten/app/forms.py b/kosten/app/forms.py index 818384d..61bf6f1 100644 --- a/kosten/app/forms.py +++ b/kosten/app/forms.py @@ -37,7 +37,7 @@ def lenOf(col): class Form(FlaskForm): class Meta: - locales = False + locales = ['de_DE', 'de'] def __init__ (self, *args, **kwargs): self._msg = kwargs.pop('flash', "Fehler im Formular!") @@ -55,3 +55,9 @@ class Form(FlaskForm): def validate_on_submit (self): return self.is_submitted() and self.flash_validate() + + def _get_translations(self): + # use WTForms builtin translation support instead of the flask-babael + # stuff added by flask-wtf + # FIXME: remove this, if flask-babel is used in the app + return WTForm._get_translations(self) -- cgit v1.2.3