Django's default i18n system uses the code language (for instance, English) as translation keys; translations into other languages must be written from that base language. For instance, in a Django template, you would write {% trans "Hello" %} and then translate "Hello" into "Bonjour" or "Hola" in the French or Spanish translation file.
This has a major flaw: words that are spelled the same in English cannot be translated differently in other languages. For instance, if I use {% trans "Fire" %} in two places of my code, one of which meaning the thing that burns, and the other using a cannon, I would need "Feu" and "Tirer" respectively in French; but Django's i18n forces me to choose a single translation for "Fire".
The translation keys pattern solves this: I use translation keys such as {% trans "campsite.fire" %} and {% trans "cannon.fire" %} in my code, that I translate as "Fire" in an English translation file and as "Feu" and "Tirer" respectively in the French file.
Is this a supported use of Django's i18n system? How do I inject variables into such translations?
{% trans "cannon.fire" %}will work fine. - Michael Lindsay