title: Using forms with django-translated-fields
body: <p>Please take a look at this issue:</p>
  
  <p><a href="https://github.com/matthiask/django-translated-fields/issues/10" rel="nofollow noreferrer">How do I use ModelForm with django-translated-fields?</a></p>
  
  <p>Do you have any solution?</p>
  
  <p>In short, I'm trying to convert Speedy Net from using <code>django-modeltranslation</code> to <code>django-translated-fields</code>. I defined the models and forms and everything works in English, but in another language (Hebrew) I have a problem that the form fields are defined in English instead of Hebrew (the current language). What did I do wrong and how do I define the form to work in the current language? (the fields defined by TranslatedField in the model should be visible only with the current language in the form SpeedyMatchProfileActivationForm).</p>
  
  <p>I want to clarify that the desired definition is not as above. The desired definition is to use the current language in the form and not always English. Using English when the current language is not English is a bug.</p>
  
  <p>You can see the code here:</p>
  
  <p><a href="https://github.com/speedy-net/speedy-net/tree/uri_try_django_translated_fields_2019-03-26_a" rel="nofollow noreferrer">tree</a></p>
  
  <p><a href="https://github.com/speedy-net/speedy-net/blob/uri_try_django_translated_fields_2019-03-26_a/speedy/match/accounts/forms.py" rel="nofollow noreferrer">forms.py</a></p>
  
  <p><a href="https://github.com/speedy-net/speedy-net/blob/uri_try_django_translated_fields_2019-03-26_a/speedy/match/accounts/models.py" rel="nofollow noreferrer">models.py</a></p>
  
  <p>The problem right now is with the class <code>SpeedyMatchProfileActivationForm</code> (defined in <a href="https://github.com/speedy-net/speedy-net/blob/uri_try_django_translated_fields_2019-03-26_a/speedy/match/accounts/forms.py" rel="nofollow noreferrer">forms.py</a>). I think it is mainly because the class is defined before <code>get_language()</code> returns anything. But when the class was defined with <code>django-modeltranslation</code> (for example in branch <a href="https://github.com/speedy-net/speedy-net/blob/staging/speedy/match/accounts/forms.py" rel="nofollow noreferrer">staging</a>), it worked.</p>
  
  <p>By the way, one of the reasons I want to switch to <code>django-translated-fields</code> is because it defines only 2 (the number of languages) fields in the database, and <code>django-modeltranslation</code> defines 3 fields - one of them (the main field without any language) seems to me not necessary at all. Take a look at:
  <a href="https://github.com/deschler/django-modeltranslation/issues/488" rel="nofollow noreferrer">Remove original language field on migrations</a></p>
  
  <p><code>class SpeedyMatchProfileActivationForm</code> is defined now (with <code>django-translated-fields</code>, <a href="https://github.com/speedy-net/speedy-net/blob/uri_try_django_translated_fields_2019-03-26_a/speedy/match/accounts/forms.py" rel="nofollow noreferrer">link</a>):</p>
  
  <pre><code>class SpeedyMatchProfileActivationForm(forms.ModelForm):
      validators = {
          'height': [speedy_match_accounts_validators.validate_height],
          'smoking_status': [speedy_match_accounts_validators.validate_smoking_status],
          'marital_status': [speedy_match_accounts_validators.validate_marital_status],
          to_attribute(name='profile_description'): [speedy_match_accounts_validators.validate_profile_description],
          to_attribute(name='city'): [speedy_match_accounts_validators.validate_city],
          to_attribute(name='children'): [speedy_match_accounts_validators.validate_children],
          to_attribute(name='more_children'): [speedy_match_accounts_validators.validate_more_children],
          to_attribute(name='match_description'): [speedy_match_accounts_validators.validate_match_description],
          'gender_to_match': [speedy_match_accounts_validators.validate_gender_to_match],
          'min_age_match': [speedy_match_accounts_validators.validate_min_age_match],
          'max_age_match': [speedy_match_accounts_validators.validate_max_age_match],
          'diet_match': [speedy_match_accounts_validators.validate_diet_match],
          'smoking_status_match': [speedy_match_accounts_validators.validate_smoking_status_match],
          'marital_status_match': [speedy_match_accounts_validators.validate_marital_status_match],
      }
      diet = forms.ChoiceField(choices=User.DIET_VALID_CHOICES, widget=forms.RadioSelect(), label=_('My diet'), validators=[speedy_match_accounts_validators.validate_diet])
      photo = forms.ImageField(required=False, widget=CustomPhotoWidget, label=_('Add profile picture'))
  
      class Meta:
          model = SpeedyMatchSiteProfile
          fields = ('photo', to_attribute(name='profile_description'), to_attribute(name='city'), 'height', to_attribute(name='children'), to_attribute(name='more_children'), 'diet', 'smoking_status', 'marital_status', 'gender_to_match', to_attribute(name='match_description'), 'min_age_match', 'max_age_match', 'diet_match', 'smoking_status_match', 'marital_status_match')
          widgets = {
              'smoking_status': forms.RadioSelect(),
              'marital_status': forms.RadioSelect(),
              to_attribute(name='profile_description'): forms.Textarea(attrs={'rows': 3, 'cols': 25}),
              to_attribute(name='city'): forms.TextInput(),
              to_attribute(name='children'): forms.TextInput(),
              to_attribute(name='more_children'): forms.TextInput(),
              to_attribute(name='match_description'): forms.Textarea(attrs={'rows': 3, 'cols': 25}),
              'diet_match': CustomJsonWidget(choices=User.DIET_VALID_CHOICES),
              'smoking_status_match': CustomJsonWidget(choices=SpeedyMatchSiteProfile.SMOKING_STATUS_VALID_CHOICES),
              'marital_status_match': CustomJsonWidget(choices=SpeedyMatchSiteProfile.MARITAL_STATUS_VALID_CHOICES),
          }
  </code></pre>
  
  <p>It was previously defined (with <code>django-modeltranslation</code>, <a href="https://github.com/speedy-net/speedy-net/blob/uri_main_branch_2019-03-25_a/speedy/match/accounts/forms.py" rel="nofollow noreferrer">link</a>):</p>
  
  <pre><code>class SpeedyMatchProfileActivationForm(TranslationModelForm):
      validators = {
          'height': [speedy_match_accounts_validators.validate_height],
          'min_age_match': [speedy_match_accounts_validators.validate_min_age_match],
          'max_age_match': [speedy_match_accounts_validators.validate_max_age_match],
          'smoking_status': [speedy_match_accounts_validators.validate_smoking_status],
          'city': [speedy_match_accounts_validators.validate_city],
          'marital_status': [speedy_match_accounts_validators.validate_marital_status],
          'children': [speedy_match_accounts_validators.validate_children],
          'more_children': [speedy_match_accounts_validators.validate_more_children],
          'profile_description': [speedy_match_accounts_validators.validate_profile_description],
          'match_description': [speedy_match_accounts_validators.validate_match_description],
          'gender_to_match': [speedy_match_accounts_validators.validate_gender_to_match],
          'diet_match': [speedy_match_accounts_validators.validate_diet_match],
          'smoking_status_match': [speedy_match_accounts_validators.validate_smoking_status_match],
          'marital_status_match': [speedy_match_accounts_validators.validate_marital_status_match],
      }
      diet = forms.ChoiceField(choices=User.DIET_VALID_CHOICES, widget=forms.RadioSelect(), label=_('My diet'), validators=[speedy_match_accounts_validators.validate_diet])
      photo = forms.ImageField(required=False, widget=CustomPhotoWidget, label=_('Add profile picture'))
  
      class Meta:
          model = SpeedyMatchSiteProfile
          fields = ('photo', 'profile_description', 'city', 'height', 'children', 'more_children', 'diet', 'smoking_status', 'marital_status', 'gender_to_match', 'match_description', 'min_age_match', 'max_age_match', 'diet_match', 'smoking_status_match', 'marital_status_match')
          widgets = {
              'profile_description': forms.Textarea(attrs={'rows': 3, 'cols': 25}),
              'children': forms.TextInput(),
              'more_children': forms.TextInput(),
              'smoking_status': forms.RadioSelect(),
              'marital_status': forms.RadioSelect(),
              'match_description': forms.Textarea(attrs={'rows': 3, 'cols': 25}),
              'diet_match': CustomJsonWidget(choices=User.DIET_VALID_CHOICES),
              'smoking_status_match': CustomJsonWidget(choices=SpeedyMatchSiteProfile.SMOKING_STATUS_VALID_CHOICES),
              'marital_status_match': CustomJsonWidget(choices=SpeedyMatchSiteProfile.MARITAL_STATUS_VALID_CHOICES),
          }
  </code></pre>
  
  <p>Thanks!</p>