Added USE_I18N setting, which lets you turn off internationalization overhead with a single setting. Defaults to True. Currently only affects the admin i18n JavaScript, but I'll be adding other optimizations.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3247 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-07-01 03:09:14 +00:00
parent c81d69354a
commit 4a324ba7ac
5 changed files with 44 additions and 3 deletions

View file

@ -104,6 +104,13 @@ function interpolate(fmt, obj, named) {
}
"""
def null_javascript_catalog(request, domain=None, packages=None):
"""
Returns "identity" versions of the JavaScript i18n functions -- i.e.,
versions that don't actually do anything.
"""
return http.HttpResponse(NullSource + InterPolate, 'text/javascript')
def javascript_catalog(request, domain='djangojs', packages=None):
"""
Returns the selected language catalog as a javascript library.
@ -191,4 +198,3 @@ def javascript_catalog(request, domain='djangojs', packages=None):
src.append(InterPolate)
src = ''.join(src)
return http.HttpResponse(src, 'text/javascript')