django i18n : gettext didn't translate one line

227 views Asked by At

UPDATE:

I solve it by use % to replace %

<h3>{% trans "Is it 100&#37; free?" %}</h3> 

Do anyone have better solution ??

Original question:

I use gettext to translate to chinese,But this line didn't not translate .
still output Is it 100% free?
Please someone guide me Thank you.

template :

<h3>{% trans "Is it 100% free?" %}</h3> 

django.po

#: templates/help.html:5
#, python-format
msgid "Is it 100%% free?"
msgstr "完全免費嗎?"
2

There are 2 answers

0
Evgeny Ivanov On

I like google translate. only add script in HEAD https://cloud.google.com/translate/?gclid=CKy-tanppsICFYTacgod5J8AYA

2
doniyor On

I think this is still an open issue, but you can solve it like

{% blocktrans with PERCENT_SIGN = u'%'  %}
      Is it 100{{PERCENT_SIGN}} free?
{% endblocktrans %}

Or try this way ( bug seems to be fixed)

msgstr "完全免%% 費嗎?"

You place %% to where it belongs, i dont know chinese.

One of them (or both of them) should work