Reputation: 63
I've got a script.js file which is located in common/static/js/ directory. Common is 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.
Upvotes: 6
Views: 6384
Reputation: 34553
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.
Upvotes: 9