[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/TranslationService - MessageCatalog.py:1.2
Florent Guillaume
fg@nuxeo.com
Sun, 6 Oct 2002 14:30:27 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/TranslationService
In directory cvs.zope.org:/tmp/cvs-serv21040/Zope/App/OFS/Services/TranslationService
Modified Files:
MessageCatalog.py
Log Message:
Modified translation service and message catalog interface to be able to
return None when no translation is available.
=== Zope3/lib/python/Zope/App/OFS/Services/TranslationService/MessageCatalog.py 1.1 => 1.2 ===
--- Zope3/lib/python/Zope/App/OFS/Services/TranslationService/MessageCatalog.py:1.1 Thu Jul 11 03:12:41 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/TranslationService/MessageCatalog.py Sun Oct 6 14:30:27 2002
@@ -51,10 +51,11 @@
def queryMessage(self, id, default=None):
'See Zope.I18n.IMessageCatalog.IReadMessageCatalog'
- if default is None:
- default = id
- result = removeAllProxies(self._messages.get(id, default))
- if result != default: result = result[0]
+ result = removeAllProxies(self._messages.get(id))
+ if result is not None:
+ result = result[0]
+ else:
+ result = default
return result
def getLanguage(self):