---------- Forwarded message ----------
From: Christopher R. Gabriel <[EMAIL PROTECTED]>
Date: Thu, Oct 9, 2008 at 4:06 PM
Subject: [patch] tg-I18n and string collection
To: [EMAIL PROTECTED]
Hi there!
I found a problem in the i18n string collection in TG 1.0.x using the
pygettext module.
Basically, it won't collect strings marked for translation using the
tg_i18n model, so strings like
_("Hello", lang)
won't be collected. I've patched the pygettext to get it work, attached
to this mail.
Don't know if it's already solved in newer TG releases, unfortunately I
don't have time to check for this.
Regards,
Christopher
--
Christopher R. Gabriel Truelite Srl
[EMAIL PROTECTED] (email/jabber) Via Monferrato, 6
http://www.truelite.it/ 50142 Firenze
Office. +39-055-7879597 ext. 102 Fax. +39-055-7333336
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" 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/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---
--- pygettext.py.orig 2008-10-09 14:46:57.000000000 +0200
+++ pygettext.py 2008-10-09 14:46:57.000000000 +0200
@@ -421,7 +421,12 @@
self.__state = self.__waiting
def __openseen(self, ttype, tstring, lineno):
- if ttype == tokenize.OP and tstring == ')':
+ if ttype == tokenize.OP and tstring == ',':
+ if self.__data:
+ self.__addentry(EMPTYSTRING.join(self.__data))
+ self.__state = self.__waiting
+
+ elif ttype == tokenize.OP and tstring == ')':
# We've seen the last of the translatable strings. Record the
# line number of the first line of the strings and update the list
# of messages seen. Reset state for the next batch. If there