1

I'm having one and the same string that is translated differently depending on its context. E.g.

"Subject" can be translated as "Betreff" or "Thema" in German. And they are used in different context.

Basically, I'm looking for exactly this SO Answer, but for inside a Jinja2 template

Here's Jinja2's docs about i18n, but there's no context mentioned: http://jinja.pocoo.org/docs/dev/templates/#i18n-in-templates

Community
  • 1
  • 1
Simon Steinberger
  • 6,605
  • 5
  • 55
  • 97
  • 1
    Why not use it as a key only, add translation to native lang (English) and for the rest of the languages, so for instance, mark a key as: subject_betreff, and a key as subject_thema and then add the translation, to the English and German po files accordingly. – petkostas May 19 '15 at 11:34
  • With 26 languages, I'd definitely like to make use of Django's makemessages command. At the moment, I'm creating a variable that contains the translation within the view. It works, but maybe there's a better solution. – Simon Steinberger May 19 '15 at 15:58

0 Answers0