app/django/core/context_processors.py
changeset 323 ff1a9aa48cfd
parent 54 03e267d67478
--- a/app/django/core/context_processors.py	Tue Oct 14 12:36:55 2008 +0000
+++ b/app/django/core/context_processors.py	Tue Oct 14 16:00:59 2008 +0000
@@ -38,14 +38,11 @@
     return context_extras
 
 def i18n(request):
+    from django.utils import translation
+
     context_extras = {}
     context_extras['LANGUAGES'] = settings.LANGUAGES
-    if hasattr(request, 'LANGUAGE_CODE'):
-        context_extras['LANGUAGE_CODE'] = request.LANGUAGE_CODE
-    else:
-        context_extras['LANGUAGE_CODE'] = settings.LANGUAGE_CODE
-
-    from django.utils import translation
+    context_extras['LANGUAGE_CODE'] = translation.get_language()
     context_extras['LANGUAGE_BIDI'] = translation.get_language_bidi()
 
     return context_extras
@@ -82,3 +79,7 @@
 
     def __getitem__(self, module_name):
         return PermLookupDict(self.user, module_name)
+        
+    def __iter__(self):
+        # I am large, I contain multitudes.
+        raise TypeError("PermWrapper is not iterable.")