[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/ Merged revision 69070 from the 3.3 branch:

Dmitry Vasiliev dima at hlabs.spb.ru
Mon Jul 10 09:23:18 EDT 2006


Log message for revision 69073:
  Merged revision 69070 from the 3.3 branch:
  
  In some circumstances message ids need to be treated as unicode objects.
  

Changed:
  U   Zope3/trunk/src/zope/app/apidoc/browser/menu_macros.pt
  U   Zope3/trunk/src/zope/app/apidoc/component.py
  U   Zope3/trunk/src/zope/app/apidoc/component.txt
  U   Zope3/trunk/src/zope/app/apidoc/ifacemodule/browser.txt
  UU  Zope3/trunk/src/zope/app/apidoc/presentation.py
  U   Zope3/trunk/src/zope/app/apidoc/presentation.txt
  U   Zope3/trunk/src/zope/app/container/browser/contents.pt

-=-
Modified: Zope3/trunk/src/zope/app/apidoc/browser/menu_macros.pt
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/menu_macros.pt	2006-07-10 13:13:32 UTC (rev 69072)
+++ Zope3/trunk/src/zope/app/apidoc/browser/menu_macros.pt	2006-07-10 13:23:17 UTC (rev 69073)
@@ -27,7 +27,7 @@
   <metal:block define-slot="menu-title">
     <div class="menu" i18n:translate="">Menu</div>
   </metal:block>
- 
+
   <metal:block define-slot="pre_menu" />
 
   <metal:block define-slot="menu">
@@ -79,12 +79,12 @@
         tal:attributes="href python: view.getMenuLink(node)"
         tal:content="python: view.getMenuTitle(node)"
         tal:condition="python: view.getMenuLink(node) is not None"
-        i18n:translate="">
+        >
       node/id
-    </a><tal:block 
+    </a><tal:block
         replace="python: view.getMenuTitle(node)"
         condition="python: view.getMenuLink(node) is None"
-        i18n:translate="" />
+        />
   </td>
 
     </tal:block>

Modified: Zope3/trunk/src/zope/app/apidoc/component.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/component.py	2006-07-10 13:13:32 UTC (rev 69072)
+++ Zope3/trunk/src/zope/app/apidoc/component.py	2006-07-10 13:23:17 UTC (rev 69073)
@@ -24,7 +24,7 @@
     SubscriptionRegistration,
     HandlerRegistration,
     )
-    
+
 from zope.component.registry import UtilityRegistration
 from zope.interface import Interface
 from zope.interface.interface import InterfaceClass
@@ -38,6 +38,7 @@
 from zope.app.apidoc.utilities import getPythonPath, isReferencable, renderText
 from zope.app.apidoc.utilitymodule import utilitymodule
 
+
 SPECIFIC_INTERFACE_LEVEL = 1
 EXTENDED_INTERFACE_LEVEL = 2
 GENERIC_INTERFACE_LEVEL = 4
@@ -174,8 +175,8 @@
         iface = iface.inherit
     if iface is None:
         return None
-    return {'module': getattr(iface, '__module__', '<unknown>'),
-            'name': getattr(iface, '__name__', '<unknown>')}
+    return {'module': getattr(iface, '__module__', _('<unknown>')),
+            'name': getattr(iface, '__name__', _('<unknown>'))}
 
 
 def getAdapterInfoDictionary(reg):
@@ -199,7 +200,7 @@
         'required': [getInterfaceInfoDictionary(iface)
                      for iface in reg.required
                      if iface is not None],
-        'name': getattr(reg, 'name', ''),
+        'name': unicode(getattr(reg, 'name', u'')),
         'factory': path,
         'factory_url': url,
         'doc': doc,
@@ -219,7 +220,7 @@
 
     path = getPythonPath(callable)
 
-    return {'name': reg.name or _('<i>no name</i>'),
+    return {'name': unicode(reg.name) or _('<i>no name</i>'),
             'title': getattr(factory, 'title', u''),
             'description': renderText(getattr(factory, 'description', u''),
                                       module=callable.__module__),
@@ -252,7 +253,7 @@
         if isReferencable(path):
             url = 'Code/%s' % path.replace('.', '/')
 
-    return {'name': reg.name or _('<i>no name</i>'),
+    return {'name': unicode(reg.name) or _('<i>no name</i>'),
             'url_name': utilitymodule.encodeName(reg.name or '__noname__'),
             'iface_id': iface_id,
             'path': path,

Modified: Zope3/trunk/src/zope/app/apidoc/component.txt
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/component.txt	2006-07-10 13:13:32 UTC (rev 69072)
+++ Zope3/trunk/src/zope/app/apidoc/component.txt	2006-07-10 13:23:17 UTC (rev 69073)
@@ -332,7 +332,7 @@
   {'doc': 'doc info',
    'factory': 'zope.app.apidoc.doctest.MyResult',
    'factory_url': 'zope/app/apidoc/doctest/MyResult',
-   'name': 'FooToResult',
+   'name': u'FooToResult',
    'provided': {'module': 'zope.app.apidoc.doctest', 'name': 'IResult'},
    'required': [{'module': 'zope.app.apidoc.doctest', 'name': 'IFoo'},
                 {'module': 'zope.app.apidoc.doctest', 'name': 'IBar'}],
@@ -352,7 +352,7 @@
   {'doc': 'doc info',
    'factory': 'zope.app.apidoc.doctest.MyResult2',
    'factory_url': None,
-   'name': 'FooToResult',
+   'name': u'FooToResult',
    'provided': {'module': 'zope.app.apidoc.doctest', 'name': 'IResult'},
    'required': [{'module': 'zope.app.apidoc.doctest', 'name': 'IFoo'},
                 {'module': 'zope.app.apidoc.doctest', 'name': 'IBar'}],
@@ -369,7 +369,7 @@
   {'doc': 'doc info',
    'factory': 'zope.app.apidoc.doctest.MyResult',
    'factory_url': 'zope/app/apidoc/doctest/MyResult',
-   'name': '',
+   'name': u'',
    'provided': None,
    'required': [{'module': 'zope.app.apidoc.doctest', 'name': 'IFoo'},
                 {'module': 'zope.app.apidoc.doctest', 'name': 'IBar'}],
@@ -388,7 +388,7 @@
   >>> pprint(component.getFactoryInfoDictionary(
   ...     component.getFactories(IFooBar).next()))
   {'description': u'<p>My Foo Bar</p>\n',
-   'name': 'MyFooBar',
+   'name': u'MyFooBar',
    'title': 'MyFooBar',
    'url': 'zope/app/apidoc/doctest/MyFooBar'}
 
@@ -410,7 +410,7 @@
   >>> pprint(component.getFactoryInfoDictionary(
   ...     component.getFactories(IMine).next()))
   {'description': u'',
-   'name': 'MyFactory',
+   'name': u'MyFactory',
    'title': u'',
    'url': None}
 

Modified: Zope3/trunk/src/zope/app/apidoc/ifacemodule/browser.txt
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/ifacemodule/browser.txt	2006-07-10 13:13:32 UTC (rev 69072)
+++ Zope3/trunk/src/zope/app/apidoc/ifacemodule/browser.txt	2006-07-10 13:23:17 UTC (rev 69073)
@@ -313,7 +313,7 @@
    {'doc': u'',
     'factory': 'zope.location.traversing.LocationPhysicallyLocatable',
     'factory_url': 'zope/location/traversing/LocationPhysicallyLocatable',
-    'name': '',
+    'name': u'',
     'provided': {'module': 'zope.traversing.interfaces',
                  'name': 'IPhysicallyLocatable'},
     'required': [{'module': 'zope.interface',
@@ -322,7 +322,7 @@
    {'doc': u'',
     'factory': 'zope.traversing.adapters.DefaultTraversable',
     'factory_url': 'zope/traversing/adapters/DefaultTraversable',
-    'name': '',
+    'name': u'',
     'provided': {'module': 'zope.traversing.interfaces',
                  'name': 'ITraversable'},
     'required': [{'module': 'zope.interface',
@@ -331,7 +331,7 @@
    {'doc': u'',
     'factory': 'zope.traversing.adapters.Traverser',
     'factory_url': 'zope/traversing/adapters/Traverser',
-    'name': '',
+    'name': u'',
     'provided': {'module': 'zope.traversing.interfaces',
                  'name': 'ITraverser'},
     'required': [{'module': 'zope.interface',
@@ -340,7 +340,7 @@
    {'doc': u'',
     'factory': 'zope.traversing.namespace.etc',
     'factory_url': 'zope/traversing/namespace/etc',
-    'name': 'etc',
+    'name': u'etc',
     'provided': {'module': 'zope.traversing.interfaces',
                  'name': 'ITraversable'},
     'required': [{'module': 'zope.interface',
@@ -349,7 +349,7 @@
    {'doc': u'',
     'factory': 'zope.traversing.namespace.etc',
     'factory_url': 'zope/traversing/namespace/etc',
-    'name': 'etc',
+    'name': u'etc',
     'provided': {'module': 'zope.traversing.interfaces',
                  'name': 'ITraversable'},
     'required': [{'module': 'zope.interface',
@@ -360,7 +360,7 @@
    {'doc': u'',
     'factory': 'zope.traversing.namespace.etc',
     'factory_url': 'zope/traversing/namespace/etc',
-    'name': 'etc',
+    'name': u'etc',
     'provided': {'module': 'zope.traversing.interfaces',
                  'name': 'ITraversable'},
     'required': [{'module': 'zope.interface',
@@ -371,7 +371,7 @@
    {'doc': u'',
     'factory': 'zope.traversing.namespace.etc',
     'factory_url': 'zope/traversing/namespace/etc',
-    'name': 'etc',
+    'name': u'etc',
     'provided': {'module': 'zope.traversing.interfaces',
                  'name': 'ITraversable'},
     'required': [{'module': 'zope.interface',
@@ -382,7 +382,7 @@
    {'doc': u'',
     'factory': 'zope.traversing.namespace.etc',
     'factory_url': 'zope/traversing/namespace/etc',
-    'name': 'etc',
+    'name': u'etc',
     'provided': {'module': 'zope.traversing.interfaces',
                  'name': 'ITraversable'},
     'required': [{'module': 'zope.interface',
@@ -401,7 +401,7 @@
   [{'doc': u'',
     'factory': '__builtin__.Foo',
     'factory_url': None,
-    'name': '',
+    'name': u'',
     'provided': {'module': '__builtin__', 'name': 'IFoo'},
     'required': [{'module': '__builtin__', 'name': 'IBar'}],
     'zcml': None}]
@@ -424,7 +424,7 @@
 
   >>> pprint(details.getFactories())
   [{'description': u'',
-    'name': 'FooFactory',
+    'name': u'FooFactory',
     'title': 'Foo Factory',
     'url': None}]
 
@@ -435,7 +435,7 @@
 
   >>> pprint(details.getUtilities())
   [{'iface_id': '__builtin__.IFoo',
-    'name': 'The Foo',
+    'name': u'The Foo',
     'path': '__builtin__.Foo',
     'url': None,
     'url_name': 'VGhlIEZvbw=='}]

Modified: Zope3/trunk/src/zope/app/apidoc/presentation.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/presentation.py	2006-07-10 13:13:32 UTC (rev 69072)
+++ Zope3/trunk/src/zope/app/apidoc/presentation.py	2006-07-10 13:23:17 UTC (rev 69073)
@@ -20,6 +20,7 @@
 from zope.interface import Interface
 
 from zope.app import zapi
+from zope.app.i18n import ZopeMessageFactory as _
 from zope.app.apidoc.utilities import getPythonPath, relativizePath
 from zope.app.apidoc.utilities import getPermissionIds
 from zope.app.apidoc.component import getParserInfoInfoDictionary
@@ -32,6 +33,7 @@
 from zope.publisher.interfaces.http import IHTTPRequest
 from zope.publisher.interfaces.ftp import IFTPRequest
 
+
 SPECIFIC_INTERFACE_LEVEL = 1
 EXTENDED_INTERFACE_LEVEL = 2
 GENERIC_INTERFACE_LEVEL = 4
@@ -164,7 +166,7 @@
         doc = None
         zcml = getParserInfoInfoDictionary(reg.info)
 
-    info = {'name' : reg.name or '<i>no name</i>',
+    info = {'name' : unicode(reg.name) or _('<i>no name</i>'),
             'type' : getPythonPath(getPresentationType(reg.required[-1])),
             'factory' : getViewFactoryData(reg.factory),
             'required': [getInterfaceInfoDictionary(iface)


Property changes on: Zope3/trunk/src/zope/app/apidoc/presentation.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: Zope3/trunk/src/zope/app/apidoc/presentation.txt
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/presentation.txt	2006-07-10 13:13:32 UTC (rev 69072)
+++ Zope3/trunk/src/zope/app/apidoc/presentation.txt	2006-07-10 13:23:17 UTC (rev 69073)
@@ -395,7 +395,7 @@
                'resource': None,
                'template': None,
                'url': '__builtin__/Factory'},
-   'name': 'view.html',
+   'name': u'view.html',
    'provided': {'module': 'zope.interface',
                 'name': 'Interface'},
    'read_perm': None,

Modified: Zope3/trunk/src/zope/app/container/browser/contents.pt
===================================================================
--- Zope3/trunk/src/zope/app/container/browser/contents.pt	2006-07-10 13:13:32 UTC (rev 69072)
+++ Zope3/trunk/src/zope/app/container/browser/contents.pt	2006-07-10 13:23:17 UTC (rev 69073)
@@ -79,7 +79,6 @@
                      tal:attributes="href
                                  string:${url}/@@SelectedManagementView.html"
                      tal:content="item/id"
-                     i18n:translate=""
                      >foo</a
                   ><a href="#"
                      tal:attributes="href



More information about the Zope3-Checkins mailing list