[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/form/browser/source.py I18n-ify SourceInputWidget and SourceListInputWidget's "Apply" button.

Benji York benji at zope.com
Wed May 11 13:57:15 EDT 2005


Log message for revision 30327:
  I18n-ify SourceInputWidget and SourceListInputWidget's "Apply" button.
  

Changed:
  U   Zope3/trunk/src/zope/app/form/browser/source.py

-=-
Modified: Zope3/trunk/src/zope/app/form/browser/source.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/source.py	2005-05-11 16:03:21 UTC (rev 30326)
+++ Zope3/trunk/src/zope/app/form/browser/source.py	2005-05-11 17:57:15 UTC (rev 30327)
@@ -247,18 +247,20 @@
             term = self.terms.getTerm(value)
             terms.append((term.title, term.token))
         terms.sort()
-        
+
+        apply = self._translate(_("SourceInputWidget-apply", default="Apply"))
         return (
             '<select name="%s.selection">\n'
             '%s\n'
             '</select>\n'
-            '<input type="submit" name="%s.apply" value="Apply">'
+            '<input type="submit" name="%s.apply" value="%s">'
             % (name,
                '\n'.join(
                    [('<option value="%s">%s</option>'
                      % (token, title))
                     for (title, token) in terms]),
-               name)
+               name,
+               apply)
             )
 
     required = property(lambda self: self.context.required)
@@ -443,6 +445,8 @@
 
     def _renderResults(self, results, name):
         terms = []
+        apply = self._translate(_("SourceListInputWidget-apply",
+                                  default="Apply"))
         for value in results:
             term = self.terms.getTerm(value)
             terms.append((term.title, term.token))
@@ -451,11 +455,12 @@
             '<select name="%s.selection:list" multiple>\n'
             '%s\n'
             '</select>\n'
-            '<input type="submit" name="%s.apply" value="Apply">'
+            '<input type="submit" name="%s.apply" value="%s">'
             % (name,
                '\n'.join([('<option value="%s">%s</option>' % (token, title))
                           for (title, token) in terms]),
-               name)
+               name,
+               apply)
             )
 
     def getInputValue(self):



More information about the Zope3-Checkins mailing list