from __future__ import unicode_literals

from flask_security.forms import RegisterForm
from udata.forms import fields
from udata.forms import validators


class ExtendedRegisterForm(RegisterForm):
    first_name = fields.StringField(
        'First Name', [validators.Required('First name is required')])
    last_name = fields.StringField(
        'Last Name', [validators.Required('Last name is required')])

from __future__ import unicode_literals

from flask_security.forms import RegisterForm
from udata.forms import fields
from udata.forms import validators
from udata.i18n import lazy_gettext as _

class ExtendedRegisterForm(RegisterForm):
    first_name = fields.StringField(
        _('First name'), [validators.Required(_('First name is required'))])
    last_name = fields.StringField(
        _('Last name'), [validators.Required(_('Last name is required'))])

Apply i18n to First and Last name in registration form
Apply i18n to First and Last name in registration form

  from __future__ import unicode_literals
  
  from flask_security.forms import RegisterForm
  from udata.forms import fields
  from udata.forms import validators
- 
+ from udata.i18n import lazy_gettext as _
  
  class ExtendedRegisterForm(RegisterForm):
      first_name = fields.StringField(
-         'First Name', [validators.Required('First name is required')])
+         _('First name'), [validators.Required(_('First name is required'))])
      last_name = fields.StringField(
-         'Last Name', [validators.Required('Last name is required')])
+         _('Last name'), [validators.Required(_('Last name is required'))])
  
Apply i18n to First and Last name in registration form
## Code Before:
from __future__ import unicode_literals

from flask_security.forms import RegisterForm
from udata.forms import fields
from udata.forms import validators


class ExtendedRegisterForm(RegisterForm):
    first_name = fields.StringField(
        'First Name', [validators.Required('First name is required')])
    last_name = fields.StringField(
        'Last Name', [validators.Required('Last name is required')])

## Instruction:
Apply i18n to First and Last name in registration form
## Code After:
from __future__ import unicode_literals

from flask_security.forms import RegisterForm
from udata.forms import fields
from udata.forms import validators
from udata.i18n import lazy_gettext as _

class ExtendedRegisterForm(RegisterForm):
    first_name = fields.StringField(
        _('First name'), [validators.Required(_('First name is required'))])
    last_name = fields.StringField(
        _('Last name'), [validators.Required(_('Last name is required'))])
