#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)
Change History (10)
comment:1 by , 16 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
comment:2 by , 16 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 , 16 years ago
| Resolution: | invalid |
|---|---|
| Status: | closed → reopened |
| Triage Stage: | Unreviewed → Accepted |
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 , 16 years ago
| Owner: | changed from to |
|---|---|
| Status: | reopened → new |
comment:5 by , 16 years ago
| Has patch: | set |
|---|
comment:6 by , 16 years ago
| milestone: | → 1.2 |
|---|---|
| Owner: | changed from to |
comment:7 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Have a look at the "-e" option to
django-admin.py makemessages(django-admin.py help makemessages).