Overview of Django Translations
We recently had an internal talk about Django Translation (see presentation above). It’s mostly an overview of basic functionality, but it helped us realise we could be doing things better.
At the moment, our dev team is in charge of generating translations, so it’s important for us to have a basic understanding of them.
The slides look at how strings can be marked for translating using Django template tags, and methods from django.utils.translation
in python code, template html and js.
Some convenient techniques are mentioned, like using context to help in translation, or how to allow translations to have singular and plural forms.
You’ll also find url translations, useful blocktrans
options like trimmed
or asvar
, a brief look at the translation files themselves, and some recommended practices.