#5494: javascript_catalog generic view only search catalogs in
application/locale
and not in project/locale
-------------------------------------------+--------------------------------
Reporter: anonymous | Owner:
Status: new | Milestone:
Component: Internationalization | Version: SVN
Resolution: | Keywords: javascript i18n
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 1
Needs_better_patch: 0 |
-------------------------------------------+--------------------------------
Changes (by anonymous):
* cc: [email protected] (added)
Comment:
I've added a new diff, i18n.diff. While the previous patches provide for
some workarounds, all of them require that you pass a non-package
placeholder as a package argument, which doesn't seem to be very
intuitive. Since we want the javascript catalog to read from our project's
default locale location, and not from a particular package, we just need
to NOT pass any package arguments and thus bypass all of the package
verification that is causing the problem. Instead, we just have the
javacript_catalog function add the project's setting.LOCALE_PATHS to the
"paths" variable.
So in summary, the problem is simply that javascript_catalog isn't
honoring a supported setting, setting.LOCALE_PATHS, which is a tuple of
paths were you want Django to search for locale files. The setting should
look something like this:
{{{
settings.LOCALE_PATHS = ('/path/to/project/locale',)
}}}
and it is documented here:
http://docs.djangoproject.com/en/dev/ref/settings/#locale-paths
To use the project's default locale location the urls.py entry should not
pass any arguments to the view:
{{{
urlpatterns = patterns('',
(r'^jsi18n/$', 'django.views.i18n.javascript_catalog'),
)
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/5494#comment:23>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.