From
http://pylonshq.com/docs/0.9.4/internationalization.html#translations-within-templates
"""
There is one complication though. gettext's xgettext command can only
extract strings that need translating from Python code in .py files.
This means that if you write _('Hello') in a template such as a Myghty
template, xgettext will not find the string 'Hello' as one which needs
translating.
"""
You can setup xgettext to process Mighty or Mako templates quite
easily, in fact. E.g.:
i18nfiles:
find doupy/templates/ -type f -name '*myt' > doupy/i18n/filelist
find doupy/controllers/ doupy/models/ doupy/lib/ \
-type f -name '*py' >> doupy/i18n/filelist
msgcat: i18nfiles
cat doupy/i18n/filelist|xargs xgettext -o doupy/i18n/messages.pot \
--language=Python --from-code=utf-8 \
--keyword=_ --keyword=N_ --keyword=ugettext \
--keyword=gettext --keyword=ngettext --keyword=ungettext
This way you don't have to employ crufty trick with lib/i18n.py file
too.
Max.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---