Mercurial > genshi > genshi-test
comparison genshi/filters/tests/i18n.py @ 535:c8806216aec4
The I18n filter no longer extracts or translates literal strings in attribute values that also contain expressions.
author | cmlenz |
---|---|
date | Wed, 27 Jun 2007 17:58:35 +0000 |
parents | f38ce008ab0a |
children | da5cbf6d134d |
comparison
equal
deleted
inserted
replaced
534:cccb6c748609 | 535:c8806216aec4 |
---|---|
81 translator = Translator() | 81 translator = Translator() |
82 messages = list(translator.extract(tmpl.stream)) | 82 messages = list(translator.extract(tmpl.stream)) |
83 self.assertEqual(1, len(messages)) | 83 self.assertEqual(1, len(messages)) |
84 self.assertEqual((2, None, u'(c) 2007 Edgewall Software'), messages[0]) | 84 self.assertEqual((2, None, u'(c) 2007 Edgewall Software'), messages[0]) |
85 | 85 |
86 def test_ignore_attribute_with_expression(self): | |
87 tmpl = MarkupTemplate("""<html xmlns:py="http://genshi.edgewall.org/"> | |
88 <input type="submit" value="Reply" title="Reply to comment $num" /> | |
89 </html>""") | |
90 translator = Translator() | |
91 messages = list(translator.extract(tmpl.stream)) | |
92 self.assertEqual(0, len(messages)) | |
93 | |
86 | 94 |
87 class ExtractTestCase(unittest.TestCase): | 95 class ExtractTestCase(unittest.TestCase): |
88 | 96 |
89 def test_markup_template_extraction(self): | 97 def test_markup_template_extraction(self): |
90 buf = StringIO("""<html xmlns:py="http://genshi.edgewall.org/"> | 98 buf = StringIO("""<html xmlns:py="http://genshi.edgewall.org/"> |