Use the lazy version when you know that the translation database won't be
ready when the gettext function is invoked, such as in the class variable
initialization.

Use the non-lazy version when you know the translation database is ready,
such as inside a method.

https://docs.djangoproject.com/en/3.2/topics/i18n/translation/#lazy-translation

On Thu, Dec 2, 2021 at 5:14 PM ngal...@gmail.com <ngall...@gmail.com> wrote:

> Hello
> Would like to know the difference and where to use
> .Model, Views, Routers, Forms e.t.c
> gettext (from django.utils.translation import gettext)
> ugettext_lazy(from django.utils.translation import ugettext_lazy)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/fc6e8aa7-6206-4b01-bc3f-0bf02a24770en%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/fc6e8aa7-6206-4b01-bc3f-0bf02a24770en%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Regards,

Aldian Fazrihady
http://aldianfazrihady.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAN7EoAZE%3DfpFHxzmgGSoiv%2BBRT6MEczWYQ8dkQsVXyO7Yn_khQ%40mail.gmail.com.

Reply via email to