aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_babelplugin.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2013-12-24 07:04:27 -0500
committerNed Batchelder <ned@nedbatchelder.com>2013-12-24 11:10:24 -0500
commit4d813cabf9bd5dc8ea54673dae2d24a802a10fe3 (patch)
tree4344001e9dffc4104102465bef256d2c3779b59a /test/test_babelplugin.py
parent62926b5d9c3bb2d5459d8a2c78b700c33530a333 (diff)
downloadexternal_python_mako-4d813cabf9bd5dc8ea54673dae2d24a802a10fe3.tar.gz
external_python_mako-4d813cabf9bd5dc8ea54673dae2d24a802a10fe3.tar.bz2
external_python_mako-4d813cabf9bd5dc8ea54673dae2d24a802a10fe3.zip
Improved handling of translator comments in Babel plugin
There's no reason an intervening node should clear the translator comments. There's already logic that discards the comments if they occurred too far away from the harvested string. This way we can write more natural templates and still have the translator comments that provide the best translated text. http://www.makotemplates.org/trac/ticket/225
Diffstat (limited to 'test/test_babelplugin.py')
-rw-r--r--test/test_babelplugin.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/test_babelplugin.py b/test/test_babelplugin.py
index 4118f4a..df2ed0f 100644
--- a/test/test_babelplugin.py
+++ b/test/test_babelplugin.py
@@ -40,7 +40,10 @@ class ExtractMakoTestCase(TemplateTest):
(77, '_', 'Top', []),
(83, '_', 'foo', []),
(83, '_', 'hoho', []),
- (85, '_', 'bar', [])
+ (85, '_', 'bar', []),
+ (92, '_', 'Inside a p tag', ['TRANSLATOR: <p> tag is ok?']),
+ (95, '_', 'Later in a p tag', ['TRANSLATOR: also this']),
+ (99, '_', 'No action at a distance.', []),
]
self.assertEqual(expected, messages)