What does '_' do in Django code?

前端 未结 3 797
北海茫月
北海茫月 2021-02-20 13:41

Why does this Django code use _ in front of \'has favicon\'

has_favicon = models.BooleanField(_(\'has favicon\'))
3条回答
  •  抹茶落季
    2021-02-20 14:30

    _ in Django is a convention that is used for localizing texts. It is an alias for ugettext_lazy. Read Lazy translation in the docs for more info about it.

提交回复
热议问题