[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - vocabularywidget.py:1.34
Fred L. Drake, Jr.
fred@zope.com
Fri, 6 Jun 2003 16:16:30 -0400
Update of /cvs-repository/Zope3/src/zope/app/browser/form
In directory cvs.zope.org:/tmp/cvs-serv14927
Modified Files:
vocabularywidget.py
Log Message:
internationalize the no-value message
=== Zope3/src/zope/app/browser/form/vocabularywidget.py 1.33 => 1.34 ===
--- Zope3/src/zope/app/browser/form/vocabularywidget.py:1.33 Fri Jun 6 15:24:30 2003
+++ Zope3/src/zope/app/browser/form/vocabularywidget.py Fri Jun 6 16:16:30 2003
@@ -115,6 +115,10 @@
# XXX This is where we should be calling on the translation service
return msgid.default
+def message(msgid, default):
+ msgid.default = default
+ return msgid
+
# Widget implementation:
@@ -275,9 +279,11 @@
class VocabularyDisplayWidget(SingleDataHelper, VocabularyWidgetBase):
"""Simple single-selection display that can be used in many cases."""
+ _msg_no_value = message(_("vocabulary-no-value"), "(no value)")
+
def render(self, value):
if value is None:
- return "(no value)"
+ return self.translate(self._msg_no_value)
else:
term = self.context.vocabulary.getTerm(value)
return self.textForValue(term)
@@ -588,10 +594,6 @@
ADD_DONE = "adddone"
ADD_MORE = "addmore"
MORE = "more"
-
-def message(msgid, default):
- msgid.default = default
- return msgid
class IterableVocabularyQueryViewBase(VocabularyQueryViewBase):