Is it possible to change the model name in the django admin site?

后端 未结 2 1934
悲哀的现实
悲哀的现实 2020-12-14 14:54

I am translating a django app and I would like to translate also the homepage of the django admin site.

On this page are listed the application names and the model

2条回答
  •  渐次进展
    2020-12-14 15:28

    You should use the ugettext_lazy util in the Meta of all your models

    from django.db import models
    from django.utils.translation import ugettext_lazy as _
    
    class Book(models.Model):
        ...
    
        class Meta:
            verbose_name = _("My Book")
            verbose_name_plural = _("My Books")
    

提交回复
热议问题