开发者

JavaScript internationalization with django

I've got a script.js file which is located in common/static/js/ directory. Common i开发者_如何学Pythons a directory, not an application and I need to translate messages inside script into other languages. How should I configure my django project? Basic instructions please, because I'm dumm.


A simple approach is to set your translatable values at the template level for your JavaScript functions/classes to pick up:

var my_name= '{% trans my_name %}';

But Django does have JavaScript internationalization.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜