[Zope3-checkins] CVS: Zope3/src/zope/app/browser/component - interfacewidget.py:1.28

Godefroid Chapelle gotcha@swing.be
Tue, 8 Apr 2003 17:45:05 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/component
In directory cvs.zope.org:/tmp/cvs-serv17329/component

Modified Files:
	interfacewidget.py 
Log Message:
i18n



=== Zope3/src/zope/app/browser/component/interfacewidget.py 1.27 => 1.28 ===
--- Zope3/src/zope/app/browser/component/interfacewidget.py:1.27	Tue Feb 11 21:17:04 2003
+++ Zope3/src/zope/app/browser/component/interfacewidget.py	Tue Apr  8 17:44:34 2003
@@ -28,6 +28,8 @@
 from zope.component.exceptions import ComponentLookupError
 from xml.sax.saxutils import quoteattr
 
+from zope.app.i18n import ZopeMessageIDFactory as _
+
 class InterfaceWidget(Widget, BrowserView):
     __implements__ = IBrowserWidget
 
@@ -44,7 +46,7 @@
             # No user input
             if field.required and not optional:
                 raise MissingInputError(field.__name__, field.title,
-                                        'the field is required')
+                                        _(u'the field is required'))
             return field.default
         if value == 'None':
             value = None
@@ -171,7 +173,7 @@
             # No user input
             if field.required and not optional:
                 raise MissingInputError(field.__name__, field.title,
-                                        'the field is required')
+                                        _(u'the field is required'))
             return field.default
         try:
             values = tuple([nameToInterface(field, value) for value in values])
@@ -281,8 +283,8 @@
                 )
             count += 1
 
-        HTML = ('Use refresh to enter more interfaces<br>' +
-                '<br>'.join(rendered_selections))
+        HTML = (_(u'Use refresh to enter more interfaces') + '<br />' +
+                '<br />'.join(rendered_selections))
         return HTML
 
     def hidden(self):
@@ -342,11 +344,14 @@
 def renderInterfaceSelect(
         interfaces, selected, search_name, search_string, select_name):
     """interfaces is a sequence, all of the other args are strings"""
-    options = ['<option value="">---select interface---</option>']
+    options = ['<option value="">' + _(u"---select interface---") + \
+               '</option>']
     for interface in interfaces:
         if interface == 'None':
-            options.append('<option value="None"%s>Anything</option>'
-                           % (interface == selected and ' selected' or '')
+            options.append('<option value="None"%s>' \
+                % (interface == selected and ' selected' or '') \
+                + _(u"Anything") + '</option>'
+                           
                            )
         else:
             options.append('<option value="%s"%s>%s</option>'