[Checkins] SVN: z3c.pt/trunk/ Look at language set on request before invoking the zope.i18n negotiator. This makes i18n work again on Zope2.

Wichert Akkerman wichert at wiggy.net
Tue May 11 12:37:43 EDT 2010


Log message for revision 112245:
  Look at language set on request before invoking the zope.i18n negotiator. This makes i18n work again on Zope2.

Changed:
  U   z3c.pt/trunk/CHANGES.txt
  U   z3c.pt/trunk/src/z3c/pt/pagetemplate.py

-=-
Modified: z3c.pt/trunk/CHANGES.txt
===================================================================
--- z3c.pt/trunk/CHANGES.txt	2010-05-11 11:53:09 UTC (rev 112244)
+++ z3c.pt/trunk/CHANGES.txt	2010-05-11 16:37:43 UTC (rev 112245)
@@ -9,6 +9,9 @@
   in. Incidentally, the name ``args`` was used as the star argument
   name.
 
+- Look at language set on request before invoking the zope.i18n
+  negotiator. This makes i18n work again on Zope2.
+
 1.1.1 (2010/04/06)
 ------------------
 

Modified: z3c.pt/trunk/src/z3c/pt/pagetemplate.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/pagetemplate.py	2010-05-11 11:53:09 UTC (rev 112244)
+++ z3c.pt/trunk/src/z3c/pt/pagetemplate.py	2010-05-11 16:37:43 UTC (rev 112245)
@@ -107,10 +107,12 @@
             context = self._pt_get_context(ob, request, kwargs)
             request = request or context.get('request')
             if target_language is None:
-                try:
-                    target_language = i18n.negotiate(request)
-                except:
-                    target_language = None
+                target_language = request.get("LANGUAGE", None)
+                if target_language is None:
+                    try:
+                        target_language = i18n.negotiate(request)
+                    except:
+                        target_language = None
 
             context['target_language'] = target_language
             context['econtext'] = utils.econtext(context)



More information about the checkins mailing list