diff options
author | Philipp von Weitershausen <philipp@weitershausen.de> | 2006-05-20 13:32:39 +0000 |
---|---|---|
committer | Philipp von Weitershausen <philipp@weitershausen.de> | 2006-05-20 13:32:39 +0000 |
commit | 00bec85b368755107cabd6c1b64d9ec6b86200fa (patch) | |
tree | 0227083898acd8423c23715635b4f4470107705d | |
parent | 0b6ad0b07d6baa8477c3aefdb49b10cfb2ead820 (diff) | |
download | zope-tal-00bec85b368755107cabd6c1b64d9ec6b86200fa.tar.gz |
Forward port from 3.3 branch:
------------------------------------------------------------------------
r68193 | philikon | 2006-05-20 15:03:52 +0200 (Sat, 20 May 2006) | 3 lines
Make the default TALES context aware of other forms of text (e.g. i18n Messages).
This gets rid of some code duplication in zope.app's TALES context.
------------------------------------------------------------------------
r68194 | philikon | 2006-05-20 15:04:50 +0200 (Sat, 20 May 2006) | 4 lines
Added a test for automatic translation of inserted i18n Messages
(I wasn't sure whether this was working now so I just wrote this test since
I didn't find any other proof that it would, other than the code).
-rw-r--r-- | tests/test_talinterpreter.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_talinterpreter.py b/tests/test_talinterpreter.py index b00e3a0..f9158ee 100644 --- a/tests/test_talinterpreter.py +++ b/tests/test_talinterpreter.py @@ -154,6 +154,16 @@ class I18NCornerTestCaseBase(TestCaseBase): '<span i18n:translate="" tal:replace="foo"/>') self._check(program, 'FOOVALUE\n') + # i18n messages defined in Python are translated automatically + # (no i18n:translate necessary) + program, macros = self._compile( + '<span tal:content="foo" />') + self._check(program, '<span>FOOVALUE</span>\n') + + program, macros = self._compile( + '<span tal:replace="foo" />') + self._check(program, 'FOOVALUE\n') + def test_text_variable_translate(self): program, macros = self._compile( '<span tal:content="bar"/>') |