[Zope3-checkins] CVS: zopeproducts/bugtracker - vocabulary.py:1.5
Stephan Richter
srichter at cosmos.phy.tufts.edu
Tue Aug 12 19:51:29 EDT 2003
Update of /cvs-repository/zopeproducts/bugtracker
In directory cvs.zope.org:/tmp/cvs-serv18230/src/zopeproducts/bugtracker
Modified Files:
vocabulary.py
Log Message:
Use sane user data (i.e. the title)
Add domain to templates.
=== zopeproducts/bugtracker/vocabulary.py 1.4 => 1.5 ===
--- zopeproducts/bugtracker/vocabulary.py:1.4 Tue Aug 12 14:55:07 2003
+++ zopeproducts/bugtracker/vocabulary.py Tue Aug 12 18:50:55 2003
@@ -252,10 +252,18 @@
setattr(instance, self.name, _(value))
+
# Monkey Patching going on...
+from zope.app.services.servicenames import Translation
from zope.app.browser.form.vocabularywidget import ViewSupport
+from zope.i18n.messageid import MessageID
def textForValue(self, term):
- return getattr(term, 'title', term.token)
+ text = getattr(term, 'title', term.token)
+ if isinstance(text, MessageID):
+ ts = getService(self.context, Translation)
+ text = ts.translate(text, context=self.request)
+ return text
+
ViewSupport.textForValue = textForValue
More information about the Zope3-Checkins
mailing list