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.
gettext_lazy is a callable within the django. utils. translation module of the Django project.
Rosetta is a Django application that facilitates the translation process of your Django projects. Because it doesn't export any models, Rosetta doesn't create any tables in your project's database.
django created . mo files which he uses to get translated strings. MO files: MO, or Machine Object is a binary data file that contains object data referenced by a program. It is typically used to translate program code, and may be loaded or imported into the GNU gettext program. created files.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With