Ticket #7072: 7072_i18n_context_processor_fix.diff
File 7072_i18n_context_processor_fix.diff, 729 bytes (added by , 17 years ago) |
---|
-
django/core/context_processors.py
40 40 def i18n(request): 41 41 context_extras = {} 42 42 context_extras['LANGUAGES'] = settings.LANGUAGES 43 if hasattr(request, 'LANGUAGE_CODE'):44 context_extras['LANGUAGE_CODE'] = request.LANGUAGE_CODE45 else:46 context_extras['LANGUAGE_CODE'] = settings.LANGUAGE_CODE47 43 48 44 from django.utils import translation 45 context_extras['LANGUAGE_CODE'] = translation.get_language() 49 46 context_extras['LANGUAGE_BIDI'] = translation.get_language_bidi() 50 47 51 48 return context_extras