[Zope3-checkins] CVS: Zope3/src/zope/i18n - globaltranslationservice.py:1.6

Fred L. Drake, Jr. fred@zope.com
Thu, 3 Apr 2003 15:18:11 -0500


Update of /cvs-repository/Zope3/src/zope/i18n
In directory cvs.zope.org:/tmp/cvs-serv27986

Modified Files:
	globaltranslationservice.py 
Log Message:
Make sure we still do interpolation when we use the default text.


=== Zope3/src/zope/i18n/globaltranslationservice.py 1.5 => 1.6 ===
--- Zope3/src/zope/i18n/globaltranslationservice.py:1.5	Fri Mar 28 19:06:25 2003
+++ Zope3/src/zope/i18n/globaltranslationservice.py	Thu Apr  3 15:18:11 2003
@@ -88,19 +88,19 @@
                     break
                 
         # Did the fallback fail?  Sigh, return None
-        if catalog_names is None:
-            return default
-
-        for name in catalog_names:
-            catalog = self._data[name]
-            text = catalog.queryMessage(msgid)
-            if text is not None:
-                break
-        else:
-            return default
+        text = default
+        if catalog_names:
+            for name in catalog_names:
+                catalog = self._data[name]
+                s = catalog.queryMessage(msgid)
+                if s is not None:
+                    text = s
+                    break
 
         # Now we need to do the interpolation
-        return self.interpolate(text, mapping)
+        if text is not None:
+            text = self.interpolate(text, mapping)
+        return text
 
 translationService = GlobalTranslationService()