[Zope3-checkins] SVN: Zope3/branches/hdima-language-namespace/src/zope/app/ Comment added

Dmitry Vasiliev dima at hlabs.spb.ru
Thu Oct 20 09:20:29 EDT 2005


Log message for revision 39531:
  Comment added
  

Changed:
  U   Zope3/branches/hdima-language-namespace/src/zope/app/publisher/browser/__init__.py
  U   Zope3/branches/hdima-language-namespace/src/zope/app/traversing/tests/test_lang.py

-=-
Modified: Zope3/branches/hdima-language-namespace/src/zope/app/publisher/browser/__init__.py
===================================================================
--- Zope3/branches/hdima-language-namespace/src/zope/app/publisher/browser/__init__.py	2005-10-20 13:17:36 UTC (rev 39530)
+++ Zope3/branches/hdima-language-namespace/src/zope/app/publisher/browser/__init__.py	2005-10-20 13:20:29 UTC (rev 39531)
@@ -137,8 +137,8 @@
     directlyProvides(request, *ifaces)
 
 class NotCompatibleAdapterError(Exception):
-    """Adapter not compatible with ModifiableBrowserLanguages
-       adapter has been used.
+    """Adapter not compatible with
+       zope.i18n.interfaces.IModifiableBrowserLanguages has been used.
     """
 
 class CacheableBrowserLanguages(BrowserLanguages):
@@ -169,7 +169,11 @@
         annotations = IAnnotations(self.request)
         languages_data = annotations.get(key)
         if languages_data is None:
+            # Better way to create a compatible with
+            # IModifiableUserPreferredLanguages adapter is to use
+            # CacheableBrowserLanguages as base class or as example.
             raise NotCompatibleAdapterError("Adapter not compatible with "
-                "ModifiableBrowserLanguages adapter has been used.")
+                "zope.i18n.interfaces.IModifiableBrowserLanguages "
+                "has been used.")
         languages_data["overridden"] = languages
         self.request.setupLocale()

Modified: Zope3/branches/hdima-language-namespace/src/zope/app/traversing/tests/test_lang.py
===================================================================
--- Zope3/branches/hdima-language-namespace/src/zope/app/traversing/tests/test_lang.py	2005-10-20 13:17:36 UTC (rev 39530)
+++ Zope3/branches/hdima-language-namespace/src/zope/app/traversing/tests/test_lang.py	2005-10-20 13:20:29 UTC (rev 39531)
@@ -37,7 +37,7 @@
         self["HTTP_ACCEPT_LANGUAGE"] = languages
 
     def setupLocale(self):
-        self.localized = True
+        pass
 
     def shiftNameToApplication(self):
         self.shifted = True
@@ -61,7 +61,6 @@
         ob = object()
         ob2 = lang(ob, request).traverse('ru', ())
         self.failUnless(ob is ob2)
-        self.failUnless(request.localized)
         self.failUnless(request.shifted)
         self.failUnlessEqual(["ru"], browser_languages.getPreferredLanguages())
 



More information about the Zope3-Checkins mailing list