Handling percent-sign (%) in Django blocktrans tags

后端 未结 3 437
星月不相逢
星月不相逢 2021-01-12 23:55

I\'m currently localizing my Django app. All other translations work fine except percent-sign inside blocktrans tags.

In my template I have {% blocktrans %}Ori

相关标签:
3条回答
  • 2021-01-13 00:08

    Check out this ticket - it's not a solution, but it sheds light on what's going on

    0 讨论(0)
  • 2021-01-13 00:08

    Another ticket has been opened for this particular issue, with a patch that fixes it. Hopefully it will be fixed for Django 1.4.

    https://code.djangoproject.com/ticket/16721

    0 讨论(0)
  • 2021-01-13 00:10

    Couldn't find a real solution to the problem, so I used a workaround: create a constant PERCENT_SIGN = u'%' and use that as {{ PERCENT_SIGN }} inside blocktrans-blocks.

    0 讨论(0)
提交回复
热议问题