== Example ==
`appA`: app that contains the widget `FunkyJSWidget` that relies on some
javascript and needs jsi18n.
`appMain`: your main app that contains all the views for your website.
Your website also contains some javascript code that also uses jsi18n. It
uses `appA.FunkyJSWidget` on some forms as well.
`INSTALLED_APPS` now is `('appA', 'appMain')`.
The problem now occurs on all your pages that use `appA.FunkyJSWidget`.
Because the widget includes its javascript_catalog (per Media-class for
example) as well as your `appMain`, one will override the other. You could
obviously add `appA` to `appMain.views.jsi18n`'s `packages` argument but
this shouldn't be necessary.
== Possible Solution ==
Modify `django.views.i18n.js_catalog_template` to detect if a catalog
already exists. If it does, update it instead of overriding it. A minor
issue is that the template omits some functions if they are not needed.
That should be checked for all included javascript_catalogs, too.
--
Ticket URL: <https://code.djangoproject.com/ticket/22106>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => assigned
* needs_better_patch: => 0
* needs_tests: => 0
* owner: nobody => moritzs
* needs_docs: => 0
* has_patch: 0 => 1
Comment:
pull request: https://github.com/django/django/pull/2362
--
Ticket URL: <https://code.djangoproject.com/ticket/22106#comment:1>
* type: Cleanup/optimization => Bug
--
Ticket URL: <https://code.djangoproject.com/ticket/22106#comment:2>
* owner: moritzs => MoritzS
--
Ticket URL: <https://code.djangoproject.com/ticket/22106#comment:3>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/22106#comment:4>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/22106#comment:5>
* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin
Comment:
Thank you for your comments!
I corrected the errors and tests are now also passing in python2.7.
--
Ticket URL: <https://code.djangoproject.com/ticket/22106#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"6bb2175ed65456dda2f8ba584f206ba4bbd43dbc" 6bb2175]:
{{{
#!CommitTicketReference repository=""
revision="6bb2175ed65456dda2f8ba584f206ba4bbd43dbc"
Fixed #22106 -- Allowed using more than one instance of javascript_catalog
per project.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22106#comment:7>