# How to translate forms.py forms using trans? {% trans '' %}

**URL:** <https://forum.djangoproject.com/t/how-to-translate-forms-py-forms-using-trans-trans/15399>\
**Category:** Internationalization\
**Created:** [August 12, 2022, 10:21pm UTC](https://forum.djangoproject.com/t/how-to-translate-forms-py-forms-using-trans-trans/15399 "2022-08-12T22:21:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![retegi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/retegi/32/24003_2.png) [@retegi](https://forum.djangoproject.com/u/retegi)\
**Post date:** [August 12, 2022, 10:21pm UTC](https://forum.djangoproject.com/t/how-to-translate-forms-py-forms-using-trans-trans/15399/1 "2022-08-12T22:21:55Z")

</div>

Hi, I translate all static content with no problem. But how can I translate the forms that are shown in the template?  
In template I use: {% trans ‘Example’ %}  
How can I use ‘trans’ in forms?

Thanks!

**Forms.py**

```auto
class LoginForm(forms.ModelForm):
    username = forms.CharField(label='User')
    password = forms.CharField(label='Password')

    class Meta:
        model = User
        fields = ('username', 'password')

    def __init__ (self,*args, **kwargs):
        super(LoginForm, self). __init__ (*args, **kwargs)
        self.fields['username'].widget.attrs.update({'class': 'form-control'})
        self.fields['username'].label = "User"
        self.fields['password'].widget.attrs.update({'class': 'form-control','type':'password'})
        self.fields['password'].label = "Password"

```

**Settings.py**

```auto
LANGUAGE_CODE = 'EU'
ugettext = lambda s: s 
LANGUAGES = (
    ('EN', '{}'.format(ugettext('EN'))),
    ('ES', '{}'.format(ugettext('ES'))),
    ('EU', '{}'.format(ugettext('EU'))),
    ('FR', '{}'.format(ugettext('FR'))),
)

TIME_ZONE = 'Europe/Madrid'
USE_I18N = True
USE_L10N = True
USE_TZ = True
LOCALE_PATHS = (
    os.path.join(BASE_DIR, "locale"),
)

```

---

<div class="post-metadata">

**Author:** ![claudep](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/claudep/32/5377_2.png) [@claudep](https://forum.djangoproject.com/u/claudep)\
**Post date:** [August 13, 2022, 7:03am UTC](https://forum.djangoproject.com/t/how-to-translate-forms-py-forms-using-trans-trans/15399/2 "2022-08-13T07:03:54Z")

</div>

Looks like you really need to read [Translation | Django documentation | Django](https://docs.djangoproject.com/en/4.1/topics/i18n/translation/) !!
