Django:trans和blocktrans没有逃避模数(%)

时间:2010-10-06 03:36:40

标签: django internationalization

我正在尝试在包含模数的翻译模板上制作消息,就像这样;

{% trans "100% escaping problems sucks" %}

但是我收到了这个错误:

Error: errors happened while running xgettext on site.html
./templates/site.html.py:34: warning: 'msgid' format string with unnamed 
arguments cannot be properly localized:

The translator cannot reorder the arguments.
Please consider using a format string with named arguments,
and a mapping instead of a tuple for the arguments.

如果我试图像这样逃避它;

{% trans "100%% escaping problems sucks" %}

我收到此错误;

Error: errors happened while running xgettext on site.html.py
xgettext: error while opening "./templates/site.html.py" for 
reading: No such file or directory

我不知道它为什么要寻找./templates/site.html.py ..它应该是./templates/site.html

有什么想法吗?

编辑:我忘记了Django版本,它是1.2.0 beta1

1 个答案:

答案 0 :(得分:0)

根据this ticket,您可以尝试升级到至少1.2.1 ...