Hi everybody, a while ago I commited a patch [1] for i18n in TG 1.1 that allowed translatable strings in Genshi templates to be collected with "tg-admin i18n collect".
The current function does not collect any strings within Python expressions, because with the Genshi Translator filter [2] you do not need to wrap your translatable strings in gettext function calls. This works good so far, since the Translator filter is automatically added in the Genshi renderer by TurboGears [3]. But in the interest of easy porting of Kid templates it would be nice to also support strings in gettext function calls. So I created a patch [4] to collect them. But it will currently lead to an error when you actually use gettext function calls (e.g. ${_(u'Translatable string')}) in your Genshi templates, because the gettext function ('_') is not injected into the template namespace yet. I tried to figure out how this is done for kid, but the i18n code is so convoluted, I didn't succeed yet. Can anybody point me in the right direction? Do you all think this is a worthwhile enhancement or should we just document how to use i18n in Genshi templates without explicit gettext function calls? Chris [1] http://trac.turbogears.org/changeset/5799 [2] http://genshi.edgewall.org/wiki/Documentation/0.5.x/i18n.html [3] http://trac.turbogears.org/changeset/5714 [4] http://trac.turbogears.org/ticket/2368 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to turbogears-trunk@googlegroups.com To unsubscribe from this group, send email to turbogears-trunk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~---