On 2/3/2010 7:48 AM, Richard Liao wrote:
Thank you, Christian.
Adding i18n:domain in templates can translate most messages now,
Great! Would you pointing me to the actual code so that I could use that
to help me document the plugin translation process?
except for strings like ${_("message")}.
I have to do some dirty thing to make it work:
<body i18n:domain="mydomain">
<?python
from trac.util.translation import dgettext
def _(string, **kwargs): return dgettext('mydomain', string, **kwargs)
?>
<form action="." method="post">
<input type="submit" name="load" value="${_('Load')}" />
</form>
</body>
Is there a clean way for this?
In the python code of your plugin, you bind the "_" function using
something like:
http://trac.edgewall.org/browser/plugins/0.12/mercurial-plugin/tracext/hg/backend.py#L33
right?
You should simply pass that into the data dictionary which will be used
by the template.
-- Christian
--
You received this message because you are subscribed to the Google Groups "Trac
Development" 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/trac-dev?hl=en.