Skip to content
Snippets Groups Projects
Commit 163bf151 authored by Philip Jenvey's avatar Philip Jenvey
Browse files

support the <%namespacename:defname> syntax in the babel extractor

fixes #118
parent b01882da
No related branches found
No related tags found
Loading
0.2.6
- Support the <%namespacename:defname> syntax in
the babel extractor. [ticket:118]
0.2.5
- Added a "decorator" kw argument to <%def>,
allows custom decoration functions to wrap
......
......@@ -67,6 +67,11 @@ def extract_nodes(nodes, keywords, comment_tags, options):
child_nodes = node.nodes
elif isinstance(node, parsetree.PageTag):
code = node.body_decl.code
elif isinstance(node, parsetree.CallNamespaceTag):
attribs = ', '.join(['%s=%s' % (key, val)
for key, val in node.attributes.iteritems()])
code = '{%s}' % attribs
child_nodes = node.nodes
elif isinstance(node, parsetree.ControlLine):
if node.isend:
translator_comments = []
......
......@@ -27,7 +27,11 @@ try:
(45, 'ungettext', (u'hella', u'hellas', None), []),
(62, '_', u'Goodbye, really!', [u'TRANSLATOR: HTML comment']),
(65, '_', u'P.S. byebye', []),
(71, '_', u'Top', [])]
(71, '_', u'Top', []),
(77, '_', u'foo', []),
(77, '_', u'baz', []),
(79, '_', u'bar', [])
]
self.assertEqual(expected, messages)
except ImportError:
......
......@@ -71,3 +71,13 @@ top = gettext('Begin')
${_('Top')}
</a>
</div>
<%def name="panel()">
${_(u'foo')} <%self:block_tpl title="123", name="_(u'baz')">
${_(u'bar')}
</%self:block_tpl>
</%def>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment