django语言翻译

时间:2011-05-11 06:05:04

标签: django

HIII 我有这个声明。我想翻译信息消息我该怎么办。它在HttpResponseRedirect下... 返回HttpResponseRedirect('/ Info?info =您还没有登录')..

我想翻译成德语你还没有登录到德国的东西。我知道我必须更新po文件..

但如果使用('/ Info?info =您还没有登录')::::错误  如果我使用('/ Info?info = (你还没有登录'))::::错误。 请帮忙!!!!!! 提前致谢

1 个答案:

答案 0 :(得分:0)

您可能需要使用字符串构建器来格式化它:

from django.utils.translation import ugettext as _
return HttpResponseRedirect('/Info?info=%s' % (_('You have not logged in yet'),))