[Zope3-checkins] SVN: Zope3/trunk/src/zope/tal/t Now an error will be raised if explicit message id and tal:content are used together

Dmitry Vasiliev dima at hlabs.spb.ru
Wed May 11 05:28:31 EDT 2005


Log message for revision 30322:
  Now an error will be raised if explicit message id and tal:content are used together
  

Changed:
  U   Zope3/trunk/src/zope/tal/talgenerator.py
  U   Zope3/trunk/src/zope/tal/tests/test_talinterpreter.py

-=-
Modified: Zope3/trunk/src/zope/tal/talgenerator.py
===================================================================
--- Zope3/trunk/src/zope/tal/talgenerator.py	2005-05-10 18:18:41 UTC (rev 30321)
+++ Zope3/trunk/src/zope/tal/talgenerator.py	2005-05-11 09:28:31 UTC (rev 30322)
@@ -541,6 +541,11 @@
                     "i18n:translate and tal:replace are mutually exclusive",
                     position)
 
+        if content and msgid:
+            raise I18NError(
+                "explicit message id and tal:content can't be used together",
+                position)
+
         repeatWhitespace = None
         if repeat:
             # Hack to include preceding whitespace in the loop program

Modified: Zope3/trunk/src/zope/tal/tests/test_talinterpreter.py
===================================================================
--- Zope3/trunk/src/zope/tal/tests/test_talinterpreter.py	2005-05-10 18:18:41 UTC (rev 30321)
+++ Zope3/trunk/src/zope/tal/tests/test_talinterpreter.py	2005-05-11 09:28:31 UTC (rev 30322)
@@ -214,6 +214,12 @@
             I18NError, self._compile,
             '<span i18n:translate="" tal:content="foo" i18n:name="foo_name"/>')
 
+    def test_content_with_explicit_messageid(self):
+        # Let's tell the user this is incredibly silly!
+        self.assertRaises(
+            I18NError, self._compile,
+            '<span i18n:translate="ID" tal:content="foo" />')
+
     def test_content_with_plaintext_and_i18nname_and_i18ntranslate(self):
         # Let's tell the user this is incredibly silly!
         self.assertRaises(



More information about the Zope3-Checkins mailing list