开发者

Translation in template with placeholders

in my .po file i have

msgid "This string will have %s inside."

How can i translate this in template?

I've tried:

{% blocktrans %}This string will have {{ value }} inside.{% endblocktrans %}

and

{% blocktrans with value as value%}This string will ha开发者_开发百科ve {{ value }} inside.{% endblocktrans %}

Neither works for me


As stated in the documentation, the strings should use Python's standard named-string interpolation syntax.

So {% blocktrans %}This string will have {{ value }} inside.{% endblocktrans %} will use the translation string "This string will have %(value)s inside.".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜