Reputation: 701
I am more or less a python noob and while getting my hands dirty, in one of the modules I am using, I encountered this statement:
from django.utils.translation import ugettext, ugettext_lazy as _
The statement is django and i18n related, but the question is of a more general nature... I think. So, if I use _("some string to be translated")
in my code, which one is the function called, ugettext or ugettext_lazy?
Upvotes: 0
Views: 98
Reputation: 37319
The comma divides up clauses of the import statement. That code is equivalent to:
from django.utils.translation import ugettext
from django.utils.translation import ugettext_lazy as _
Upvotes: 3