[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/form/ Stop
translating labels and hints in the label and hint properties.
Jim Fulton
jim at zope.com
Tue Nov 8 17:57:44 EST 2005
Log message for revision 39990:
Stop translating labels and hints in the label and hint properties.
These are already translated by the templates using the data.
Changed:
U Zope3/trunk/src/zope/app/form/__init__.py
U Zope3/trunk/src/zope/app/form/browser/tests/test_browserwidget.py
-=-
Modified: Zope3/trunk/src/zope/app/form/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/form/__init__.py 2005-11-08 22:57:41 UTC (rev 39989)
+++ Zope3/trunk/src/zope/app/form/__init__.py 2005-11-08 22:57:44 UTC (rev 39990)
@@ -38,14 +38,12 @@
self.request = request
self.name = self._prefix + context.__name__
- label = property(lambda self: self._translate(
- self.context.title))
+ label = property(lambda self: self.context.title)
- hint = property(lambda self: self._translate(
- self.context.description))
+ hint = property(lambda self: self.context.description)
def _translate(self, text):
- return translate(text, "zope", context=self.request, default=text)
+ return translate(text, context=self.request, default=text)
def _renderedValueSet(self):
"""Returns ``True`` if the the widget's rendered value has been set.
Modified: Zope3/trunk/src/zope/app/form/browser/tests/test_browserwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/tests/test_browserwidget.py 2005-11-08 22:57:41 UTC (rev 39989)
+++ Zope3/trunk/src/zope/app/form/browser/tests/test_browserwidget.py 2005-11-08 22:57:44 UTC (rev 39990)
@@ -35,6 +35,7 @@
from zope.app.form.browser.tests import support
import zope.app.form.browser.tests
+
class BrowserWidgetTest(PlacelessSetup,
support.VerifyResults,
unittest.TestCase):
@@ -105,17 +106,7 @@
self.setUpContent(desc=u'Foo Description')
self.assertEqual(self._widget.hint, u'Foo Description')
- def testTranslatedLabel(self):
- path = os.path.dirname(zope.app.form.browser.tests.__file__)
- catalog = GettextMessageCatalog(
- 'pl', 'zope', os.path.join(path, 'testlabeltranslation.mo'))
- domain = TranslationDomain('zope')
- domain.addCatalog(catalog)
- ztapi.provideUtility(ITranslationDomain, domain, 'zope')
- ztapi.provideUtility(INegotiator, negotiator)
- self.assertEqual(self._widget.label, 'oofay itletay')
-
class TestWidget(SimpleInputWidget):
def _toFieldValue(self, v):
More information about the Zope3-Checkins
mailing list