Hi All,
I have a mako def which does some stuff on the body of the bit of mako
that it wraps. Unfortunately text wrapped in this manner seems to get
ignored by gettext/babel. For example insert the snippet below into a
file called test.mako:
<%def name="render()"><%
context.write(capture(caller.body))
%></%def>
<%self:render>
${_('This is only a test please translate me')}
</%self:render>
from paster shell you can run:
render('/test.mako')
Out[1]: literal(u'\n\n\n\n\nThis is only a test please translate me\n
\n')
I am using this form of 'wrapped' def to allow me to do some fancy
cachin depending on the parameters i pass to render - not shown above
- but the above scenario will demonstrate the problem. When you run:
python2.5 setup.py extract_messages
The message 'This is only a test.. ' fails to appear in the pot and po
files. If the text is taken out of the render call, it appears.
Any suggestions would be welcome, as this is quite an important part
of the project. Would anyone happen to know what I could do to get
babel to extract these messages?
Thank you very much in advance,
Damian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---