Thanks, i will try this way. Does it work for javascript files as
well?

> web.template.Template.globals['_'] = gettext.gettext
if you are using webpy 0.3, then this is deprecated

I'm using something like this

lang = gettext.translation('messages', os.path.join(os.path.dirname
(__file__), config['locale_dir']) , languages=config['languages'])
lang.install(unicode=1)
render = web.template.render('templates/', globals={'_': _})



On Nov 30, 4:23 am, Zhang Huangbin <[EMAIL PROTECTED]> wrote:
> On Nov 30, 3:13 am, andrei <[EMAIL PROTECTED]> wrote:
>
> > Oh, please tell me how do you use it with pygettext.py
>
> Hi, andrei.
>
> Here is my code:
> ----
> python pygettext.py -a -v \
>     -d ${DOMAIN} \
>     -o ${DOMAIN}.po \
>     ../*.py ../libs/*.py ../templates/default/*.html
> ----
>
> It will print msg like this:
> ----
> Working on ../code.py
> Working on ../templates/default/index.html
> ----
>
> The content of pot file:
> ----
> #
> # ... skip some lines here ...
> #
>
> #: ../code.py:40
> msgid "Message"
> msgstr ""
>
> #: ../templates/default/index.html:6
> msgid "World"
> msgstr ""
> ----
>
> But i still can't make the $_("Message") work in template file (not as
> variable).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to