[ZPT] CVS: Zope/lib/python/TAL - TALInterpreter.py:1.69.6.7

Florent Guillaume fg@nuxeo.com
Tue, 24 Sep 2002 11:54:12 -0400


Update of /cvs-repository/Zope/lib/python/TAL
In directory cvs.zope.org:/tmp/cvs-serv521

Modified Files:
      Tag: Zope-2_6-branch
	TALInterpreter.py 
Log Message:
Slightly clarified code.


=== Zope/lib/python/TAL/TALInterpreter.py 1.69.6.6 => 1.69.6.7 ===
--- Zope/lib/python/TAL/TALInterpreter.py:1.69.6.6	Tue Sep 24 11:39:29 2002
+++ Zope/lib/python/TAL/TALInterpreter.py	Tue Sep 24 11:54:11 2002
@@ -355,9 +355,7 @@
                     ok = 0
                 value = evalue
         if msgid:
-            xlated = self.i18n_attribute(value)
-            if xlated is not None:
-                value = xlated
+            value = self.i18n_attribute(value)
         if value is None:
             value = name
         value = '%s="%s"' % (name, escape(value, 1))
@@ -367,8 +365,11 @@
     def i18n_attribute(self, s):
         # s is the value of an attribute before translation
         # it may have been computed
-        # This may return None if no translation is available.
-        return self.translate(s, {})
+        xlated = self.translate(s, {})
+        if xlated is None:
+            return s
+        else:
+            return xlated
 
     def no_tag(self, start, program):
         state = self.saveState()