Python: What does _("str") do?
- by Rosarch
I see this in the Django source code:
description = _("Comma-separated integers")
description = _("Date (without time)")
What does it do? I try it in Python 3.1.3 and it fails:
>>> foo = _("bar")
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
foo = _("bar")
NameError: name '_' is not defined
No luck in 2.4.4 either:
>>> foo = _("bar")
Traceback (most recent call last):
File "<pyshell#1>", line 1, in -toplevel-
foo = _("bar")
NameError: name '_' is not defined
What's going on here?