Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#12377 closed (wontfix)

Make the makemessages command more open

Reported by: Renskers Owned by: nobody
Component: Internationalization Version:
Severity: Keywords: makemessages i18n
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I am using Jinja2 instead of the Django template system in a test project. Everything is working fine, but I am running into a small problem regarding i18n:

The command "django-admin makemessages" doesn't find the translation strings, because the Jinja2 format differs from the Django format.

Django syntax:

{% trans "Hello" %}
{% blocktrans %}Hello{% endblocktrans %}

Jinj2 syntax:

{{ _('Hello') }}
{% trans %}Hello{% endtrans %}

The underscore syntax work fine, but the trans/endtrans doesn't: the regular expressions used by makemessages don't account for different template tags. As far as I can see there is no possible way to configure the system so it can work with different tags. It seems like a good idea to open this up, so different template systems can be used more easily.

Change History (3)

comment:1 Changed 6 years ago by jezdez

  • Component changed from to Internationalization
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed
  • Version 1.1 deleted

comment:2 Changed 6 years ago by ramiro

"Configuring the system so it can work with diferent tags" would mean that there needs to be support code in Django makemessages command that caters for compatibility with one third party templating system (and after the first, possibly there will be request for more). This means Django developers would need to maintain and test that code.

This would be better served by a custom template tag and/or management command users that need to use templating library X can write by themselves to cover their very specific needs. The most popular of these systems even have their own i18n system that can be used for this. In the case of Jinja2 it is Babel-based:

I'd suggest to close this ticket.

Last edited 3 years ago by ramiro (previous) (diff)

comment:3 Changed 6 years ago by jezdez

  • Resolution set to wontfix
  • Status changed from new to closed

Babel rocks with Jinja2.

Note: See TracTickets for help on using tickets.
Back to Top