diff options
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | doc/build/content/usage.txt | 2 | ||||
-rw-r--r-- | lib/mako/_ast_util.py | 3 | ||||
-rw-r--r-- | lib/mako/ext/babelplugin.py | 3 | ||||
-rw-r--r-- | test/babelplugin.py | 8 |
5 files changed, 9 insertions, 10 deletions
@@ -20,6 +20,9 @@ to work correctly. - fixed Python 2.3 compat. in mako.pyparser [ticket:90] +- fix Babel 0.9.3 compatibility; stripping comment tags is now + optional (and enabled by default). + 0.2.2 - cached blocks now use the current context when rendering diff --git a/doc/build/content/usage.txt b/doc/build/content/usage.txt index b4bfd8c..443cdcb 100644 --- a/doc/build/content/usage.txt +++ b/doc/build/content/usage.txt @@ -233,7 +233,7 @@ Invoking [Babel](http://babel.edgewall.org/)'s extractor at the command line in Will output a gettext catalog to stdout including the following: - #. This is a proper name. See the gettext + #. TRANSLATORS: This is a proper name. See the gettext #. manual, section Names. #: myproj/templates/name.html:5 msgid "Francois Pinard" diff --git a/lib/mako/_ast_util.py b/lib/mako/_ast_util.py index 968084b..0051dfe 100644 --- a/lib/mako/_ast_util.py +++ b/lib/mako/_ast_util.py @@ -46,9 +46,6 @@ if sys.platform.startswith('java'): result = result.split(".")[-1] if result.endswith("Type"): result = result[:-4] - if result == "Unicode": - # XXX: likely unecessary now - result = "Str" return result else: diff --git a/lib/mako/ext/babelplugin.py b/lib/mako/ext/babelplugin.py index 33d3523..e16e133 100644 --- a/lib/mako/ext/babelplugin.py +++ b/lib/mako/ext/babelplugin.py @@ -55,9 +55,8 @@ def extract_nodes(nodes, keywords, comment_tags, options): for comment_tag in comment_tags: if value.startswith(comment_tag): in_translator_comments = True - comment = value[len(comment_tag):].strip() translator_comments.extend(_split_comment(node.lineno, - comment)) + value)) continue if isinstance(node, parsetree.DefTag): diff --git a/test/babelplugin.py b/test/babelplugin.py index f925591..9e9491c 100644 --- a/test/babelplugin.py +++ b/test/babelplugin.py @@ -16,16 +16,16 @@ try: [(1, '_', u'Page arg 1', []), (1, '_', u'Page arg 2', []), (10, 'gettext', u'Begin', []), - (14, '_', u'Hi there!', [u'Hi there!']), + (14, '_', u'Hi there!', [u'TRANSLATOR: Hi there!']), (19, '_', u'Hello', []), (22, '_', u'Welcome', []), (25, '_', u'Yo', []), - (36, '_', u'The', [u'Ensure so and', u'so, thanks']), + (36, '_', u'The', [u'TRANSLATOR: Ensure so and', u'so, thanks']), (36, 'ungettext', (u'bunny', u'bunnies', None), []), - (41, '_', u'Goodbye', [u'Good bye']), + (41, '_', u'Goodbye', [u'TRANSLATOR: Good bye']), (44, '_', u'Babel', []), (45, 'ungettext', (u'hella', u'hellas', None), []), - (62, '_', u'Goodbye, really!', [u'HTML comment']), + (62, '_', u'Goodbye, really!', [u'TRANSLATOR: HTML comment']), (65, '_', u'P.S. byebye', []), (71, '_', u'Top', [])] self.assertEqual(expected, messages) |