I add ugettext alias _ in to context. now, no error.but the _ function can't read /conf/local/zh_TW or /zh_CN mo file in my project. can read mo file from django package.second: how can make mako template work with babelplugin, whta is relation between mako and babel.
2010/8/24 BIN JANNE <pang...@gmail.com>i want make Internationalization in mako template.but i don't konw how to do ?this is my code segment:<% import mako.ext.babelplugin %><%inherit file="/layouts/main.html" /><%def name="title()">${model._meta.verbose_name} ${_("Admin")}</%def>but it throw error:TypeError: 'Undefined' object is not callableit appears mako don't know how to deal with '_'.sorry my poor english!
--
You received this message because you are subscribed to the Google Groups "Mako Templates for Python" group.
To post to this group, send email to mako-d...@googlegroups.com.
To unsubscribe from this group, send email to mako-discuss...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mako-discuss?hl=en.
2010/8/25 Michael Bayer <mik...@zzzcomputing.com>:
> I've never used Babel and it would be nice if someone who has could chime in
> here, but the docs for this are at :
> http://www.makotemplates.org/docs/usage.html#usage_common_babel
I have only used Babel in Mako with Pylons, which is all
pre-configured for you. You may want to create a dummy Pylons project
and see how it is set up. Or at least read the Pylons documentation on
internationalization (i18n), it may give you some hints on how to set
it up.
--
Alex
twitter.com/alexconrad