开发者

Translation in template with placeholders

开发者 https://www.devze.com 2022-12-08 09:15 出处:网络
in my .po file i have msgid \"This string will have %s inside.\" How can i translate this in template? I\'ve tried:

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

精彩评论

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

关注公众号