Answer the question
In order to leave comments, you need to log in
How to translate Label value in python django?
It is necessary that the name of the form is displayed in the template. the record {{ form.last_name.label }} outputs in English (as written in the forms and model). Is there a way to translate the titles? and where/how is it done?
directly in the template through {% trans %} does not work.
thanks in advance)
Answer the question
In order to leave comments, you need to log in
app/models.py
#-*- coding:utf-8 -*-
from django.utils.translation import ugettext_lazy as _
class Registration(models.Model):
...
create = models.DateTimeField(_(u"#Создано"), auto_now_add=True, blank=True, null=True)
class Meta:
verbose_name = _(u'#Регистрация')
verbose_name_plural = _(u'#Подтверждение регистрации')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question