Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fuchsia.googlesource.com-third_party-mako
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fuchsia-mirror
fuchsia.googlesource.com-third_party-mako
Commits
163bf151
Commit
163bf151
authored
15 years ago
by
Philip Jenvey
Browse files
Options
Downloads
Patches
Plain Diff
support the <%namespacename:defname> syntax in the babel extractor
fixes #118
parent
b01882da
No related branches found
No related tags found
Loading
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGES
+4
-0
4 additions, 0 deletions
CHANGES
lib/mako/ext/babelplugin.py
+5
-0
5 additions, 0 deletions
lib/mako/ext/babelplugin.py
test/babelplugin.py
+5
-1
5 additions, 1 deletion
test/babelplugin.py
test_htdocs/gettext.mako
+10
-0
10 additions, 0 deletions
test_htdocs/gettext.mako
with
24 additions
and
1 deletion
CHANGES
+
4
−
0
View file @
163bf151
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
...
...
This diff is collapsed.
Click to expand it.
lib/mako/ext/babelplugin.py
+
5
−
0
View file @
163bf151
...
...
@@ -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
=
[]
...
...
This diff is collapsed.
Click to expand it.
test/babelplugin.py
+
5
−
1
View file @
163bf151
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
test_htdocs/gettext.mako
+
10
−
0
View file @
163bf151
...
...
@@ -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>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment