[Zope3-checkins] CVS: Zope3/src/zope/app/content - image.py:1.9
zpt.py:1.14
Stephan Richter
srichter at cosmos.phy.tufts.edu
Wed Aug 6 11:45:46 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/content
In directory cvs.zope.org:/tmp/cvs-serv18235/app/content
Modified Files:
image.py zpt.py
Log Message:
Mainly I18n of the ISized adapters.
=== Zope3/src/zope/app/content/image.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/content/image.py:1.8 Sat Jun 7 02:37:23 2003
+++ Zope3/src/zope/app/content/image.py Wed Aug 6 10:45:10 2003
@@ -22,6 +22,7 @@
from zope.app.size import byteDisplay
from zope.app.content_types import guess_content_type
+from zope.app.i18n import ZopeMessageIDFactory as _
from zope.interface import implements
__metaclass__ = type
@@ -69,7 +70,13 @@
if h < 0:
h = '?'
bytes = self._image.getSize()
- return '%s %sx%s' % (byteDisplay(bytes), w, h)
+ byte_size = byteDisplay(bytes)
+ mapping = byte_size.mapping
+ size = _(byte_size + ' ${width}x${height}')
+ mapping.update({'width': str(w), 'height': str(h)})
+ size.mapping = mapping
+ return size
+
def getImageInfo(data):
data = str(data)
=== Zope3/src/zope/app/content/zpt.py 1.13 => 1.14 ===
--- Zope3/src/zope/app/content/zpt.py:1.13 Sat Jun 7 02:37:23 2003
+++ Zope3/src/zope/app/content/zpt.py Wed Aug 6 10:45:10 2003
@@ -26,6 +26,7 @@
from zope.pagetemplate.pagetemplate import PageTemplate
from zope.app.pagetemplate.engine import AppPT
+from zope.app.i18n import ZopeMessageIDFactory as _
from zope.app.interfaces.index.text import ISearchableText
from zope.app.interfaces.size import ISized
from zope.app.interfaces.content.zpt import IZPTPage, IRenderZPTPage
@@ -119,8 +120,10 @@
def sizeForDisplay(self):
'See ISized'
if self.num_lines == 1:
- return '1 line'
- return '%s lines' % self.num_lines
+ return _('1 line')
+ lines = _('${lines} lines')
+ lines.mapping = {'lines': str(self.num_lines)}
+ return lines
# File-system access adapters
More information about the Zope3-Checkins
mailing list