[z3-checkins] r21965 - z3/CMFonFive/trunk

regebro at codespeak.net regebro at codespeak.net
Wed Jan 11 18:36:55 CET 2006


Author: regebro
Date: Wed Jan 11 18:36:55 2006
New Revision: 21965

Modified:
   z3/CMFonFive/trunk/CHANGES.txt
   z3/CMFonFive/trunk/fiveactionstool.py
Log:
The test if title was unicode does not work under Zope 3.2.


Modified: z3/CMFonFive/trunk/CHANGES.txt
==============================================================================
--- z3/CMFonFive/trunk/CHANGES.txt	(original)
+++ z3/CMFonFive/trunk/CHANGES.txt	Wed Jan 11 18:36:55 2006
@@ -1,5 +1,11 @@
 CMFonFive Product Changelog
 
+  After CMFonFive 1.3.0
+
+   - The new zope.i18nmessageid.Message is actually a subclass of unicode, 
+     so the test to make sure it was not a Message or a MessageID competely
+     failed, making menu item titles untranslated.
+
   CMFonFive 1.3.0 (2006-01-05)
       
     - The five_template support was removed as it provided little extra

Modified: z3/CMFonFive/trunk/fiveactionstool.py
==============================================================================
--- z3/CMFonFive/trunk/fiveactionstool.py	(original)
+++ z3/CMFonFive/trunk/fiveactionstool.py	Wed Jan 11 18:36:55 2006
@@ -73,8 +73,13 @@
                     filter = Expression(text=str(entry['filter']))
 
                 title = entry['title']
-                # Having bits of unicode here can make rendering very confused.
-                if isinstance(title, unicode):
+                # Having bits of unicode here can make rendering very confused,
+                # so we convert it to plain strings, but NOT if it is a 
+                # messageID. In Zope 3.2 there are two types of messages,
+                # Message and MessageID, where MessageID is depracated. We can 
+                # type-check for both but that provokes a deprecation warning, 
+                # so we check for the "domain" attribute instead. 
+                if not hasattr(title, 'domain'):
                     title = str(title)
                 act = ActionInformation(id=act_id,
                     title=title,


More information about the z3-checkins mailing list