ian*_*man 4 javascript django interpolation internationalization
django中javascript翻译的文档仅给出了复数插值的示例.我想做一些简单的事情,如下所示:
var format = gettext("Displaying %(count)s / %(total)s")
var text = interpolate(format, {"count": 5, "total": 10})
Run Code Online (Sandbox Code Playgroud)
应该设置text为Displaying 5 / 10
但这不适合我.我得到Displaying %(count)s / %(total)s的价值为text.
有谁知道怎么做这种简单的插值?
你错过了true论点:
var text = interpolate(format, {"count": 5, "total": 10}, true);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1295 次 |
| 最近记录: |