Commit 0fce18e3 authored by Serge S. Koval's avatar Serge S. Koval

Fixed wtforms babel domain

parent 216a66b6
...@@ -52,10 +52,12 @@ else: ...@@ -52,10 +52,12 @@ else:
class Translations(object): class Translations(object):
''' Fixes WTForms translation support and uses wtforms translations ''' ''' Fixes WTForms translation support and uses wtforms translations '''
def gettext(self, string): def gettext(self, string):
return wtforms_domain.gettext(string) t = wtforms_domain.get_translations()
return t.ugettext(string)
def ngettext(self, singular, plural, n): def ngettext(self, singular, plural, n):
return wtforms_domain.ngettext(singular, plural, n) t = wtforms_domain.get_translations()
return t.ungettext(singular, plural, n)
# lazy imports # lazy imports
......
...@@ -934,6 +934,7 @@ def test_form_args(): ...@@ -934,6 +934,7 @@ def test_form_args():
# ensure shared field_args don't create duplicate validators # ensure shared field_args don't create duplicate validators
create_form = view.create_form() create_form = view.create_form()
eq_(len(create_form.test.validators), 2) eq_(len(create_form.test.validators), 2)
edit_form = view.edit_form() edit_form = view.edit_form()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment