I upgraded to django 1.2 and I now get this error message which looks related to i18n. Can you tell what I should do? thanks
global name '_' is not defined
Traceback (most recent call last):
File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 515, in __call__
handler.get(*groups)
File "/base/data/home/apps/classifiedsmarket/blobstore.348713784647505124/i18n.py", line 252, in get
loginmsg = loginmsg + '<a href=\"%s\">%s</a>' % ('login',_("Log in"))
NameError: global name '_' is not defined
UPDATE after having added the new import statement the code looks like
# let user choose authenticator
for p in openIdProviders:
p_name = p.split('.')[0] # take "AOL" from "AOL.com"
p_url = p.lower() # "AOL.com" -> "aol.com"
loginmsg = loginmsg + '<a href="%s">%s</a> ' % ( #'','')
# users.create_login_url(federated_identity=p_url), p_name)
'google.com', p_name)
loginmsg = loginmsg + '<a href=\"%s\">%s</a>' % ('login',_("Log in"))
and in template
<ul><li><a href="ai">{% trans "Add" %}</a></li>
<li><a href="li">{{ latest.modified|date:"d M" }}</a></li>
<li>{% if user %}<a href="{{ user_url|fix_ampersands }}">{% trans "Log out" %}</a>
{% else %}{% trans "Log in" %}{{loginmsg}}{% endif %}</li>
</ul>
leading the junk on the view like the image here where the expected output is links and buttons. Could you inform a bit more? Thanks

Now inspected the HTML it appears that it’s something with the escpae coding. COuld you tell?
<ul><li><a href="ai">Add</a></li><li><a href="li">03 Mar</a></li>
<li>Log in<a href="google.com">Google</a> <a href="google.com">Yahoo</a> <a href="google.com">MySpace</a> <a href="google.com">AOL</a> <a href="login">Log in</a></li>
</ul>
Found this at Old Django 1.0 manual (App Engine’s default version is 0.98 I think).
Here’s the answer:
That’s why the old one works, meanwhile in Django 1.2 you need to specify:
as Niklas R suggested.