[Fixed]-Django ugettext_lazy and ugettext not working in form field label

1👍

You should pass label as an argument to the form, not as a widget attribute.

class PageForm(forms.ModelForm):
    title = forms.CharField(label=ugettext_lazy('Title'),
                            widget=forms.TextInput(attrs={'class':'form-control'}),
                            )
    ...

Leave a comment