Opened 10 years ago

Closed 9 years ago

#24167 closed New feature (wontfix)

Backend-agnostic template internationalization

Reported by: Aymeric Augustin Owned by:
Component: Internationalization Version: dev
Severity: Normal Keywords: multiple-template-engines
Cc: Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently makemessages calls django.utils.translation.templatize to turn Django templates into something gettext understands. There is no way for alternate template engines to hook into the string extraction machinery.

This supersedes #20811 and #23299.

Change History (7)

comment:1 by Aymeric Augustin, 10 years ago

Owner: changed from nobody to Aymeric Augustin
Status: newassigned

comment:2 by Aymeric Augustin, 10 years ago

Since this ticket describes a new feature and wasn't implemented before 1.8 alpha, it will make it into 1.9 at best. I will use the approach described in #23299 in 1.8 because it's less invasive.

comment:3 by Aymeric Augustin, 10 years ago

Owner: Aymeric Augustin removed
Status: assignednew
Triage Stage: AcceptedSomeday/Maybe

For the record, I didn't use that approach, I recommended using Babel instead. [Edit: this sentence used Jinja2 instead of Babel by mistake]

It's increasingly unclear to me that this is a problem that needs solving.

I'll leave the ticket open because 1.8 has been released only recently.

However I don't plan to work on it and I won't be surprised if it ends up as wontfix.

Last edited 10 years ago by Aymeric Augustin (previous) (diff)

comment:4 by Carl Meyer, 10 years ago

Aymeric: I think you meant to say "I recommended using Babel instead"? Or else I'm misunderstanding something.

I think that "just use Babel instead" is a fine option, and there's not much value in having makemessages wrap Babel.

(In the long run, I wonder if we could deprecate makemessages and just recommend https://pypi.python.org/pypi/django-babel instead).

comment:5 by Aymeric Augustin, 10 years ago

Yes I meant Babel.

comment:6 by Preston Timmons, 10 years ago

I wonder how many people using Jinja2 with Django use Babel? The django-jinja library, at least, takes the approach of overriding the makemessages command instead.

Personally, I've found Babel much less constrained than makemessages when the translation workflow requires anything custom, e.g. multiple domain files, files that shouldn't automatically remove obsolete strings, combining po files from multiple apps from a single repository into one, only extracting pot files, etc. These are situational, but with Babel there's minimal retooling necessary if you want to do it. The same can't be said for makemessages.

comment:7 by Aymeric Augustin, 9 years ago

Resolution: wontfix
Status: newclosed

I haven't heard anyone requesting this since Django 1.8 was released. I assume everyone is happily using Babel.

I'm going to close this as wontfix because there doesn't appear to be a need for this feature. If you think there is, please bring it up on the DevelopersMailingList.

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