[CMF-checkins] SVN: CMF/trunk/CMFDefault/utils.py - made sure Exception messages are translated correctly if they are i18n message objects

Yvo Schubbe y.2006_ at wcm-solutions.de
Tue May 16 14:06:06 EDT 2006


Log message for revision 68153:
  - made sure Exception messages are translated correctly if they are i18n message objects

Changed:
  U   CMF/trunk/CMFDefault/utils.py

-=-
Modified: CMF/trunk/CMFDefault/utils.py
===================================================================
--- CMF/trunk/CMFDefault/utils.py	2006-05-16 15:22:44 UTC (rev 68152)
+++ CMF/trunk/CMFDefault/utils.py	2006-05-16 18:06:05 UTC (rev 68153)
@@ -19,7 +19,6 @@
 import re
 import StringIO
 import rfc822
-from cgi import escape
 from sgmllib import SGMLParser
 
 from AccessControl import ModuleSecurityInfo
@@ -451,6 +450,11 @@
     """ Translate i18n message.
     """
     GTS = getGlobalTranslationService()
+    if isinstance(message, Exception):
+        try:
+            message = message[0]
+        except TypeError, IndexError:
+            pass
     return GTS.translate('cmf_default', message, context=context)
 
 security.declarePublic('Message')



More information about the CMF-checkins mailing list