Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
i18n: translate form labels
Browse files Browse the repository at this point in the history
Adds missing translation of form labels.  (closes #628)
  • Loading branch information
jirikuncar committed May 22, 2017
1 parent 7c9c1b3 commit c027cea
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions flask_security/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
from flask import Markup, current_app, flash, request
from flask_login import current_user
from flask_wtf import FlaskForm as BaseForm
from werkzeug.local import LocalProxy
from speaklater import make_lazy_gettext
from wtforms import BooleanField, Field, HiddenField, PasswordField, \
StringField, SubmitField, ValidationError, validators

from .confirmable import requires_confirmation
from .utils import _, config_value, get_message, url_for_security, \
validate_redirect_url, verify_and_update_password
from .utils import _, _datastore, config_value, get_message, \
localize_callback, url_for_security, validate_redirect_url, \
verify_and_update_password

# Convenient reference
_datastore = LocalProxy(lambda: current_app.extensions['security'].datastore)
lazy_gettext = make_lazy_gettext(lambda: localize_callback)

_default_field_labels = {
'email': _('Email Address'),
Expand Down Expand Up @@ -72,7 +72,7 @@ class Length(ValidatorMixin, validators.Length):


def get_form_field_label(key):
return _default_field_labels.get(key, '')
return lazy_gettext(_default_field_labels.get(key, ''))


def unique_user_email(form, field):
Expand Down

0 comments on commit c027cea

Please sign in to comment.