[Erp5-report] r40229 jerome - in /erp5/trunk/bt5/erp5_content_translation: SkinTemplateItem...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Nov 12 11:37:37 CET 2010


Author: jerome
Date: Fri Nov 12 11:37:36 2010
New Revision: 40229

URL: http://svn.erp5.org?rev=40229&view=rev
Log:
store instances of Message in workflow history, not translated strings

Modified:
    erp5/trunk/bt5/erp5_content_translation/SkinTemplateItem/portal_skins/erp5_content_translation/Base_getContentTranslationLanguageValueAndLabelList.xml
    erp5/trunk/bt5/erp5_content_translation/WorkflowTemplateItem/portal_workflow/content_translation_interaction_workflow/scripts/checkAndUpdateTranslationStatus.xml
    erp5/trunk/bt5/erp5_content_translation/bt/revision

Modified: erp5/trunk/bt5/erp5_content_translation/SkinTemplateItem/portal_skins/erp5_content_translation/Base_getContentTranslationLanguageValueAndLabelList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_content_translation/SkinTemplateItem/portal_skins/erp5_content_translation/Base_getContentTranslationLanguageValueAndLabelList.xml?rev=40229&r1=40228&r2=40229&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_content_translation/SkinTemplateItem/portal_skins/erp5_content_translation/Base_getContentTranslationLanguageValueAndLabelList.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_content_translation/SkinTemplateItem/portal_skins/erp5_content_translation/Base_getContentTranslationLanguageValueAndLabelList.xml [utf8] Fri Nov 12 11:37:36 2010
@@ -2,10 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <tuple>
-        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
-        <tuple/>
-      </tuple>
+      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -53,8 +50,8 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>Base_translateString = context.Base_translateString\n
-language_column_list = [(i[\'id\'], Base_translateString(i[\'title\']))\n
+            <value> <string>from Products.ERP5Type.Message import translateString\n
+language_column_list = [(i[\'id\'], translateString(i[\'title\']))\n
                         for i in context.Localizer.get_languages_map()]\n
 language_column_list.sort()\n
 return language_column_list\n
@@ -94,12 +91,13 @@ return language_column_list\n
                         <key> <string>co_varnames</string> </key>
                         <value>
                           <tuple>
-                            <string>_getattr_</string>
-                            <string>context</string>
-                            <string>Base_translateString</string>
+                            <string>Products.ERP5Type.Message</string>
+                            <string>translateString</string>
                             <string>append</string>
                             <string>$append0</string>
                             <string>_getiter_</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
                             <string>i</string>
                             <string>_getitem_</string>
                             <string>language_column_list</string>

Modified: erp5/trunk/bt5/erp5_content_translation/WorkflowTemplateItem/portal_workflow/content_translation_interaction_workflow/scripts/checkAndUpdateTranslationStatus.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_content_translation/WorkflowTemplateItem/portal_workflow/content_translation_interaction_workflow/scripts/checkAndUpdateTranslationStatus.xml?rev=40229&r1=40228&r2=40229&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_content_translation/WorkflowTemplateItem/portal_workflow/content_translation_interaction_workflow/scripts/checkAndUpdateTranslationStatus.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_content_translation/WorkflowTemplateItem/portal_workflow/content_translation_interaction_workflow/scripts/checkAndUpdateTranslationStatus.xml [utf8] Fri Nov 12 11:37:36 2010
@@ -50,20 +50,22 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>document = state_change_info[\'object\']\n
+            <value> <string>from Products.ERP5Type.Message import translateString\n
+document = state_change_info[\'object\']\n
 portal = state_change_info.getPortal()\n
 \n
 error_message_list = []\n
+language_item_list = portal.Base_getContentTranslationLanguageValueAndLabelList()\n
 \n
 for property_name, original_message in document.Base_getContentTranslationPropertyValueAndLabelList():\n
-  for language, language_label in document.Base_getContentTranslationLanguageValueAndLabelList():\n
+  for language, language_label in language_item_list:\n
     try:\n
       translation_original_text = document.getPropertyTranslationOriginalText(property_name, language)\n
     except KeyError:\n
       translation_original_text = None\n
     if translation_original_text is not None and translation_original_text!=original_message:\n
-      error_message = context.Base_translateString(\n
-        \'property ${property_name} of ${language} is outdated.\', mapping={\'property_name\':property_name, \'language\':language})\n
+      error_message = translateString(\n
+        \'property ${property_name} of ${language} is outdated\', mapping={\'property_name\':property_name, \'language\':language_label})\n
       error_message_list.append(error_message)\n
 \n
 \n
@@ -72,7 +74,7 @@ content_translation_state = portal.porta
 \n
 if error_message_list:\n
   if content_translation_state!=\'outdated\':\n
-    document.invalidateContentTranslation(error_message=\'\\n\'.join(map(str, error_message_list)))\n
+    document.invalidateContentTranslation(error_message=error_message_list)\n
 else:\n
   if content_translation_state!=\'latest\':\n
     document.validateContentTranslation()\n
@@ -121,11 +123,14 @@ else:\n
                         <value>
                           <tuple>
                             <string>state_change_info</string>
+                            <string>Products.ERP5Type.Message</string>
+                            <string>translateString</string>
                             <string>_getitem_</string>
                             <string>document</string>
                             <string>_getattr_</string>
                             <string>portal</string>
                             <string>error_message_list</string>
+                            <string>language_item_list</string>
                             <string>_getiter_</string>
                             <string>property_name</string>
                             <string>original_message</string>
@@ -134,11 +139,8 @@ else:\n
                             <string>translation_original_text</string>
                             <string>KeyError</string>
                             <string>None</string>
-                            <string>context</string>
                             <string>error_message</string>
                             <string>content_translation_state</string>
-                            <string>map</string>
-                            <string>str</string>
                           </tuple>
                         </value>
                     </item>

Modified: erp5/trunk/bt5/erp5_content_translation/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_content_translation/bt/revision?rev=40229&r1=40228&r2=40229&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_content_translation/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_content_translation/bt/revision [utf8] Fri Nov 12 11:37:36 2010
@@ -1 +1 @@
-34
\ No newline at end of file
+36
\ No newline at end of file




More information about the Erp5-report mailing list