'what's gettext_lazy on django is for?
maybe is a dummy question but i have read on the documentation of Django about the "gettext_lazy", but there is no clear definition for me about this exact function and i want to remove it
and i found this implementation
from django.utils.translation import gettext_lazy as _
and is used on a django model field in this way
email = models.EmailField(_('email address'), unique=True)
what's is for? what's happen if i remove it?
Solution 1:[1]
Its used for translation for creating translation files like this:
# app/locale/cs/LC_MESSAGES/django.po
#: templates/app/index.html:3
msgid "email address"
msgstr "emailová adresa"
Than it can be rendered in template as translated text. Nothing will happen if you remove it and don't want to use multilingualism.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ondrados |
