Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#11284 closed (fixed)

Support i18n tags in templates with .js extension

Reported by: Andrew Badr Owned by: Ramiro Morales
Component: Internationalization Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

We are using dynamically generated javascript that includes strings for translation. These are marked with the trans template tag. There is no way to get these strings added to a pofile, since makemessages forcefully rejects the 'js' extension.

Attachments (1)

11284.diff (538 bytes ) - added by Ramiro Morales 15 years ago.
SImple patch

Download all attachments as: .zip

Change History (10)

comment:1 by Malcolm Tredinnick, 15 years ago

Resolution: invalid
Status: newclosed

Have a look at the "-e" option to django-admin.py makemessages (django-admin.py help makemessages).

comment:2 by Ramiro Morales, 15 years ago

Malcolm, actually I think we are eplicitly rejecting the .js extension when the user specifies it with the -e/--extension command line option: http://code.djangoproject.com/browser/django/trunk/django/core/management/commands/makemessages.py?rev=10833#L226

comment:3 by Malcolm Tredinnick, 15 years ago

Resolution: invalid
Status: closedreopened
Triage Stage: UnreviewedAccepted

Ah, I understand what you (both) are saying now. My mistake. Okay, we need to let people shoot themselves in the foot so that people doing the right thing can get their work done. This is definitely worth changing, because Django's current approach to i18n in Javascript is pretty cache unfriendly, so allowing workarounds for when it's appropriate is a Good Thing.

comment:4 by Marc Garcia, 15 years ago

Owner: changed from nobody to Marc Garcia
Status: reopenednew

by Ramiro Morales, 15 years ago

Attachment: 11284.diff added

SImple patch

comment:5 by Ramiro Morales, 15 years ago

Has patch: set

comment:6 by Ramiro Morales, 15 years ago

milestone: 1.2
Owner: changed from Marc Garcia to Ramiro Morales

comment:7 by Jannis Leidel, 15 years ago

Resolution: fixed
Status: newclosed

(In [12439]) Fixed #11284 - Stop forcing the use of the djangojs domain when the ".js" file extension is passed to makemessages management command. Thanks, Ramiro Morales.

comment:8 by Jannis Leidel, 15 years ago

(In [12450]) [1.1.X] Fixed #11284 - Stop forcing the use of the djangojs domain when the ".js" file extension is passed to makemessages management command. Thanks, Ramiro Morales.

Backport of r12439.

comment:9 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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