[Zope-CVS] CVS: Products/GenericSetup - CHANGES.txt:1.3 utils.py:1.3

Tres Seaver tseaver at palladion.com
Fri Sep 23 17:26:16 EDT 2005


Update of /cvs-repository/Products/GenericSetup
In directory cvs.zope.org:/tmp/cvs-serv26236

Modified Files:
	CHANGES.txt utils.py 
Log Message:


  - Forward-ported i18n support from CMF 1.5 branch.


=== Products/GenericSetup/CHANGES.txt 1.2 => 1.3 ===
--- Products/GenericSetup/CHANGES.txt:1.2	Fri Sep 23 13:29:20 2005
+++ Products/GenericSetup/CHANGES.txt	Fri Sep 23 17:25:45 2005
@@ -2,7 +2,9 @@
 
   After GenericSetup-0.10
 
-    - Forward ported BBB # old instances that stored properties as
+    - Forward-ported i18n support from CMF 1.5 branch.
+
+    - Forward ported BBB for old instances that stored properties as
       lists from CMFSetup.
 
     - Forward ported fix for tools with non unique IDs from CMFSetup.


=== Products/GenericSetup/utils.py 1.2 => 1.3 ===
--- Products/GenericSetup/utils.py:1.2	Fri Sep 23 13:29:20 2005
+++ Products/GenericSetup/utils.py	Fri Sep 23 17:25:45 2005
@@ -212,18 +212,21 @@
 
         return {
           'object':
-            { 'name':            {KEY: 'id'},
+            { 'i18n:domain':     {},
+              'name':            {KEY: 'id'},
               'meta_type':       {},
               'insert-before':   {},
               'insert-after':    {},
               'property':        {KEY: 'properties', DEFAULT: ()},
-              'object':          {KEY: 'objects', DEFAULT: ()} },
+              'object':          {KEY: 'objects', DEFAULT: ()},
+              'xmlns:i18n':      {} },
           'property':
             { 'name':            {KEY: 'id'},
               '#text':           {KEY: 'value', DEFAULT: ''},
               'element':         {KEY: 'elements', DEFAULT: ()},
               'type':            {},
-              'select_variable': {} },
+              'select_variable': {},
+              'i18n:translate':  {} },
           'element':
             { 'value':           {KEY: None} },
           'description':
@@ -273,6 +276,9 @@
 
         [ self.initObject(obj, info) for info in o_info['objects'] ]
 
+        if 'i18n:domain' in o_info:
+            obj.i18n_domain = o_info['i18n:domain']
+
         [ self.initProperty(obj, info) for info in o_info['properties'] ]
 
     security.declareProtected(ManagePortal, 'initProperty')
@@ -352,10 +358,15 @@
 
         properties = []
         subobjects = []
+        i18n_domain = getattr(obj, 'i18n_domain', None)
 
         if getattr( aq_base(obj), '_propertyMap' ):
             for prop_map in obj._propertyMap():
-                properties.append( self._extractProperty(obj, prop_map) )
+                prop_info = self._extractProperty(obj, prop_map)
+                if i18n_domain and prop_info['id'] in ('title', 'description'):
+                    prop_info['i18ned'] = ''
+                if prop_info['id'] != 'i18n_domain':
+                    properties.append(prop_info)
 
         if getattr( aq_base(obj), 'objectValues' ):
             for sub in obj.objectValues():
@@ -363,6 +374,7 @@
 
         return { 'id': obj.getId(),
                  'meta_type': obj.meta_type,
+                 'i18n_domain': i18n_domain or None,
                  'properties': tuple(properties),
                  'subobjects': tuple(subobjects) }
 



More information about the Zope-CVS mailing list