[Erp5-report] r34640 jerome - in /erp5/trunk/bt5/erp5_ingestion: SkinTemplateItem/portal_sk...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Apr 19 10:34:57 CEST 2010


Author: jerome
Date: Mon Apr 19 10:34:57 2010
New Revision: 34640

URL: http://svn.erp5.org?rev=34640&view=rev
Log:
translate with mapping

Modified:
    erp5/trunk/bt5/erp5_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion/Base_contribute.xml
    erp5/trunk/bt5/erp5_ingestion/bt/revision

Modified: erp5/trunk/bt5/erp5_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion/Base_contribute.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion/Base_contribute.xml?rev=34640&r1=34639&r2=34640&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion/Base_contribute.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion/Base_contribute.xml [utf8] Mon Apr 19 10:34:57 2010
@@ -56,6 +56,7 @@
             <value> <string>"""\n
   Use to contribute file to ERP5.\n
 """\n
+from Products.ERP5Type.Message import translateString\n
 MARKER = [\'\', None]\n
 portal = context.getPortalObject()\n
 portal_contributions = portal.portal_contributions\n
@@ -78,7 +79,7 @@
   # we contribute and URL, this happens entirely asynchronous\n
   document = portal_contributions.newContentFromURL(url = url, \n
                                                     **document_kw)\n
-  message = "URL contributed successfully."\n
+  message = translateString("URL contributed successfully.")\n
 else:\n
   # contribute file\n
   file_name = getattr(file, \'filename\', None)\n
@@ -115,16 +116,17 @@
   # edit document   \n
   if document_edit_kw is not {}:\n
     document.edit(**document_edit_kw)\n
-  document_portal_type = document.getPortalType()\n
+  document_portal_type = document.getTranslatedPortalType()\n
   if not is_existing_document_updated:\n
-    message = \'%s created successfully.\' %document_portal_type\n
+    message = translateString(\'${portal_type} created successfully.\',\n
+                mapping=dict(portal_type=document_portal_type))\n
   else:\n
-    message = \'%s updated successfully.\' %document_portal_type\n
+    message = translateString(\'${portal_type} updated successfully.\',\n
+                mapping=dict(portal_type=document_portal_type))\n
 \n
 if redirect_to_document or redirect_url is not None:\n
   # this is an UI mode where script should handle HTTP redirects and is likely used\n
   # by ERP5 form\n
-  message = context.Base_translateString(message)\n
   if redirect_to_document and document is not None:\n
     # explicitly required to view ingested document\n
     context.REQUEST.set(\'portal_status_message\', message)\n
@@ -186,6 +188,8 @@
                             <string>redirect_url</string>
                             <string>editable_mode</string>
                             <string>kw</string>
+                            <string>Products.ERP5Type.Message</string>
+                            <string>translateString</string>
                             <string>None</string>
                             <string>MARKER</string>
                             <string>_getattr_</string>
@@ -212,9 +216,9 @@
                             <string>$append0</string>
                             <string>x</string>
                             <string>document_portal_type</string>
+                            <string>dict</string>
                             <string>ZTUtils</string>
                             <string>make_query</string>
-                            <string>dict</string>
                           </tuple>
                         </value>
                     </item>

Modified: erp5/trunk/bt5/erp5_ingestion/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ingestion/bt/revision?rev=34640&r1=34639&r2=34640&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ingestion/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_ingestion/bt/revision [utf8] Mon Apr 19 10:34:57 2010
@@ -1,1 +1,1 @@
-89
+90




More information about the Erp5-report mailing list