Changeset 3247
- Timestamp:
- 06/30/06 22:09:14 (2 years ago)
- Files:
-
- django/trunk/django/conf/global_settings.py (modified) (1 diff)
- django/trunk/django/contrib/admin/urls.py (modified) (2 diffs)
- django/trunk/django/views/i18n.py (modified) (2 diffs)
- django/trunk/docs/i18n.txt (modified) (1 diff)
- django/trunk/docs/settings.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/conf/global_settings.py
r3226 r3247 68 68 LANGUAGES_BIDI = ("he",) 69 69 70 # If you set this to False, Django will make some optimizations so as not 71 # to load the internationalization machinery. 72 USE_I18N = True 73 70 74 # Not-necessarily-technical managers of the site. They get broken link 71 75 # notifications and other various e-mails. django/trunk/django/contrib/admin/urls.py
r3009 r3247 1 from django.conf import settings 1 2 from django.conf.urls.defaults import * 3 4 if settings.USE_I18N: 5 i18n_view = 'django.views.i18n.javascript_catalog' 6 else: 7 i18n_view = 'django.views.i18n.null_javascript_catalog' 2 8 3 9 urlpatterns = patterns('', 4 10 ('^$', 'django.contrib.admin.views.main.index'), 5 11 ('^r/(\d+)/(.*)/$', 'django.views.defaults.shortcut'), 6 ('^jsi18n/$', 'django.views.i18n.javascript_catalog', {'packages': 'django.conf'}),12 ('^jsi18n/$', i18n_view, {'packages': 'django.conf'}), 7 13 ('^logout/$', 'django.contrib.auth.views.logout'), 8 14 ('^password_change/$', 'django.contrib.auth.views.password_change'), … … 30 36 ('^([^/]+)/([^/]+)/(.+)/$', 'django.contrib.admin.views.main.change_stage'), 31 37 ) 38 39 del i18n_view django/trunk/django/views/i18n.py
r2809 r3247 104 104 } 105 105 """ 106 107 def null_javascript_catalog(request, domain=None, packages=None): 108 """ 109 Returns "identity" versions of the JavaScript i18n functions -- i.e., 110 versions that don't actually do anything. 111 """ 112 return http.HttpResponse(NullSource + InterPolate, 'text/javascript') 106 113 107 114 def javascript_catalog(request, domain='djangojs', packages=None): … … 192 199 src = ''.join(src) 193 200 return http.HttpResponse(src, 'text/javascript') 194 django/trunk/docs/i18n.txt
r3125 r3247 36 36 3. Activate the locale middleware in your Django settings. 37 37 38 39 38 .. admonition:: Behind the scenes 40 39 41 40 Django's translation machinery uses the standard ``gettext`` module that 42 41 comes with Python. 42 43 If you don't need internationalization 44 ====================================== 45 46 Django's internationalization hooks are on by default, and that means there's a 47 bit of i18n-related overhead in certain places of the framework. If you don't 48 use internationalization, you should take the two seconds to set 49 ``USE_I18N = False`` in your settings file. If ``USE_I18N`` is set to 50 ``False``, then Django will make some optimizations so as not to load the 51 internationalization machinery. 52 53 See the `documentation for USE_I18N`_. 54 55 .. _documentation for USE_I18N: http://www.djangoproject.com/documentation/settings/#use-i18n 43 56 44 57 How to specify translation strings django/trunk/docs/settings.txt
r3055 r3247 739 739 is installed (see the `middleware docs`_). 740 740 741 USE_I18N 742 -------- 743 744 Default: ``True`` 745 746 A boolean that specifies whether Django's internationalization system should be 747 enabled. This provides an easy way to turn it off, for performance. If this is 748 set to ``False, Django will make some optimizations so as not to load the 749 internationalization machinery. 750 741 751 YEAR_MONTH_FORMAT 742 752 -----------------
