Differences between Django ugettext and ugettext_lazy
- by kRON
I keep rereading the Django's internationalization documentation and still don't understand when and why should I use django.translation.ugettext_lazy as opposed to django.translation.ugettext?
I understand that using ugettext_lazy means that I will deffer from translating the string until the very end.
Is it because Django parses the Accept-Language request header or the request.URL for the language code very late during the execution, which would mean that I may not be targeting the user's preferred language code if I was using ugettext?
Would that ultimately mean that I should only use ugettext if I want to enforce that the message gets explicitly translated to the language specified in settings.LANGUAGE_CODE, or the currently active language as per django.translation.get_language()?