[z3-checkins] r22057 - z3/Five/branch/Five-1.3

regebro at codespeak.net regebro at codespeak.net
Thu Jan 12 18:37:14 CET 2006


Author: regebro
Date: Thu Jan 12 18:37:14 2006
New Revision: 22057

Modified:
   z3/Five/branch/Five-1.3/CHANGES.txt
   z3/Five/branch/Five-1.3/i18n.py
Log:
* Unit tests that did i18n via Localizer would fail because the request 
  attribute that keeps Localizers list of preferred languages did not exist. 



Modified: z3/Five/branch/Five-1.3/CHANGES.txt
==============================================================================
--- z3/Five/branch/Five-1.3/CHANGES.txt	(original)
+++ z3/Five/branch/Five-1.3/CHANGES.txt	Thu Jan 12 18:37:14 2006
@@ -2,6 +2,15 @@
 Five Changes
 ============
 
+Five 1.3.2 (unreleased)
+=======================
+
+Bugfixes
+--------
+
+* Unit tests that did i18n via Localizer would fail because the request 
+  attribute that keeps Localizers list of preferred languages did not exist. 
+
 Five 1.3.1 (2006-01-08)
 =======================
 

Modified: z3/Five/branch/Five-1.3/i18n.py
==============================================================================
--- z3/Five/branch/Five-1.3/i18n.py	(original)
+++ z3/Five/branch/Five-1.3/i18n.py	Thu Jan 12 18:37:14 2006
@@ -65,6 +65,9 @@
         self.context = context
 
     def getPreferredLanguages(self):
+        if not hasattr(self.context, 'AcceptLanguage'):
+            return []
+            
         accept_language = self.context.AcceptLanguage
         langs = []
         for lang, node in accept_language.children.items():


More information about the z3-checkins mailing list