2011-05-11 202 views
0

hiii 我有這個說法。我想翻譯的信息我應該怎麼做。它在HttpResponseRedirect .. 返回HttpResponseRedirect('/ Info?info =您還沒有登錄過)'.. ..django語言翻譯

我想翻譯成德文您還沒有登錄尚未德國stuff.I KNW我必須更新po文件..

但如果使用('/信息?信息=您還沒有登錄in yet'):::: error if if('/ Info?info =(您還沒有登錄))::::錯誤。 請幫忙!!!!!! 在此先感謝

+0

你會得到什麼樣的錯誤?此外,您確實知道,對於url,您只能使用字母數字[0-9a-zA-Z],特殊字符「$ -_。+!*'(),」[不包括引號]和保留字符它可能是一些德文字母的問題)? – freakish 2011-05-11 06:17:49

+0

它給了我的頁面找不到錯誤,並翻譯整個消息並在地址欄中顯示 – user703398 2011-05-11 06:28:43

回答

0

你可能需要使用一個字符串生成器進行格式化:

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