[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/app/dav/
Merge from trunk:
Philipp von Weitershausen
philikon at philikon.de
Sun Sep 12 10:52:02 EDT 2004
Log message for revision 27507:
Merge from trunk:
------------------------------------------------------------------------
r27505 | philikon | 2004-09-12 16:46:41 +0200 (Sun, 12 Sep 2004) | 2 lines
Interpolate variables in message ids returned from ISized adapters.
------------------------------------------------------------------------
Changed:
U Zope3/branches/ZopeX3-3.0/src/zope/app/dav/adapter.py
U Zope3/branches/ZopeX3-3.0/src/zope/app/dav/tests/test_adapter.py
-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/dav/adapter.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/dav/adapter.py 2004-09-12 14:51:13 UTC (rev 27506)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/dav/adapter.py 2004-09-12 14:52:02 UTC (rev 27507)
@@ -20,6 +20,7 @@
from xml.dom import minidom
from zope.interface import implements
+from zope.i18n import translate
from zope.app import zapi
from zope.app.dav.interfaces import IDAVSchema
@@ -62,7 +63,7 @@
sized = ISized(self.context, None)
if sized is None:
return ''
- return str(sized.sizeForDisplay())
+ return str(translate(sized.sizeForDisplay()))
getcontentlength = property(getcontentlength)
def getlastmodified(self):
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/dav/tests/test_adapter.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/dav/tests/test_adapter.py 2004-09-12 14:51:13 UTC (rev 27506)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/dav/tests/test_adapter.py 2004-09-12 14:52:02 UTC (rev 27507)
@@ -24,6 +24,7 @@
from zope.app.tests.placelesssetup import setUp, tearDown
from zope.app.size.interfaces import ISized
from zope.app.filerepresentation.interfaces import IReadDirectory
+from zope.app.i18n import ZopeMessageIDFactory as _
import zope.app.location
from zope.app.dublincore.interfaces import IWriteZopeDublinCore
@@ -52,7 +53,9 @@
return None
def sizeForDisplay(self):
- return u"1 robot unit"
+ msg = _(u"${num} robot unit")
+ msg.mapping = {'num': 1}
+ return msg
class RobotDirectory(object):
implements(IReadDirectory)
@@ -147,4 +150,4 @@
))
if __name__ == '__main__':
- unittest.main()
+ unittest.main(defaultTest='test_suite')
More information about the Zope3-Checkins
mailing list