From b837ec4749814e7159c4470de3403b819c10feb4 Mon Sep 17 00:00:00 2001
From: Yusei Tahara <yusei@nexedi.com>
Date: Thu, 28 Aug 2008 15:09:35 +0000
Subject: [PATCH] 2008-08-28 yusei * Use Base_translateString or
 translateString instead of N_ for translation message.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23244 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../PaySheetTransaction_applyModel.xml           | 14 ++++++++++----
 .../PaySheetTransaction_checkParameters.xml      | 12 +++++++++---
 ...heetTransaction_getEditableObjectLineList.xml | 16 ++++++++++------
 .../PaySheetTransaction_getMovementList.xml      | 16 ++++++++++------
 bt5/erp5_payroll/bt/change_log                   |  3 +++
 bt5/erp5_payroll/bt/revision                     |  2 +-
 6 files changed, 43 insertions(+), 20 deletions(-)

diff --git a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_applyModel.xml b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_applyModel.xml
index 15c2e0e0eb3..6e862ed7815 100644
--- a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_applyModel.xml
+++ b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_applyModel.xml
@@ -65,14 +65,14 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>N_ = context.Base_translateString\n
+            <value> <string>Base_translateString = context.Base_translateString\n
 paysheet = context\n
 \n
 model = paysheet.getSpecialiseValue()\n
 \n
 if model is None:\n
   return context.Base_redirect(form_id,\n
-     keep_items=dict(portal_status_message=N_(\'No Pay Sheet Model.\')))\n
+     keep_items=dict(portal_status_message=Base_translateString(\'No Pay Sheet Model.\')))\n
 \n
 def getPropertyFromModel(model, property_name):\n
   """Get a property from the paysheet model, or from a specialised model.\n
@@ -115,7 +115,7 @@ paysheet.PaySheetTransaction_copySubObject(\'Payment Condition\')\n
 \n
 if not batch_mode:\n
   return context.Base_redirect(form_id,\n
-      keep_items=dict(portal_status_message=N_(\'Pay Sheet Transaction updated.\')))\n
+                               keep_items=dict(portal_status_message=Base_translateString(\'Pay Sheet Transaction updated.\')))\n
 </string> </value>
         </item>
         <item>
@@ -168,7 +168,7 @@ if not batch_mode:\n
                             <string>batch_mode</string>
                             <string>_getattr_</string>
                             <string>context</string>
-                            <string>N_</string>
+                            <string>Base_translateString</string>
                             <string>paysheet</string>
                             <string>model</string>
                             <string>None</string>
@@ -195,6 +195,12 @@ if not batch_mode:\n
             <key> <string>id</string> </key>
             <value> <string>PaySheetTransaction_applyModel</string> </value>
         </item>
+        <item>
+            <key> <string>uid</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
         <item>
             <key> <string>warnings</string> </key>
             <value>
diff --git a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_checkParameters.xml b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_checkParameters.xml
index fd0f9bbe272..239550bff23 100644
--- a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_checkParameters.xml
+++ b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_checkParameters.xml
@@ -74,11 +74,11 @@ paysheet_type = paysheet.getPortalType()\n
 employer      = paysheet.getDestinationSection()\n
 employee      = paysheet.getSourceSection()\n
 \n
-N_ = context.Base_translateString\n
+Base_translateString = context.Base_translateString\n
 \n
 def redirect(msg):\n
   return context.Base_redirect(form_id,\n
-      keep_items=dict(portal_status_message=N_(msg)))\n
+      keep_items=dict(portal_status_message=Base_translateString(msg)))\n
 \n
 if not paysheet.getPriceCurrency():\n
   return redirect(\'Currency is required\')\n
@@ -160,7 +160,7 @@ return context.PaySheetTransaction_viewPreview(container.REQUEST)\n
                             <string>paysheet_type</string>
                             <string>employer</string>
                             <string>employee</string>
-                            <string>N_</string>
+                            <string>Base_translateString</string>
                             <string>redirect</string>
                             <string>employer_obj</string>
                             <string>employee_obj</string>
@@ -186,6 +186,12 @@ return context.PaySheetTransaction_viewPreview(container.REQUEST)\n
             <key> <string>id</string> </key>
             <value> <string>PaySheetTransaction_checkParameters</string> </value>
         </item>
+        <item>
+            <key> <string>uid</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
         <item>
             <key> <string>warnings</string> </key>
             <value>
diff --git a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getEditableObjectLineList.xml b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getEditableObjectLineList.xml
index 3440353326c..4314fc188bd 100644
--- a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getEditableObjectLineList.xml
+++ b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getEditableObjectLineList.xml
@@ -75,8 +75,7 @@
 \n
 from Products.ERP5Type.Utils import cartesianProduct\n
 import pprint\n
-from Products.ERP5Type.Message import Message\n
-N_ = lambda msg, **kw: Message(\'erp5_ui\', msg, **kw)\n
+from Products.ERP5Type.Message import translateString\n
 \n
 def sortByIntIndex(a, b):\n
   return cmp(a.getIntIndex(), b.getIntIndex())\n
@@ -99,7 +98,7 @@ context.log(model_line_list)\n
 for model_line in model_line_list:\n
   base_category_list = model_line.getVariationBaseCategoryList()\n
   base_application_list = model_line.getBaseAmountTitleList()\n
-  translated_base_application_list = [str(N_(x)) for x in base_application_list]\n
+  translated_base_application_list = [str(translateString(x)) for x in base_application_list]\n
   base_application_list = \', \'.join(translated_base_application_list)\n
   list_of_list = []\n
   for base_category in base_category_list:\n
@@ -131,7 +130,7 @@ for model_line in model_line_list:\n
     quantity = cell.getQuantity()\n
     base = quantity\n
 \n
-    base_list = [str(N_(base_application)) for base_application in \\\n
+    base_list = [str(translateString(base_application)) for base_application in \\\n
         model_line.getBaseAmountTitleList()]\n
     base_name = \'+\'.join(base_list)\n
 \n
@@ -285,8 +284,7 @@ return line_list\n
                             <string>cartesianProduct</string>
                             <string>pprint</string>
                             <string>Products.ERP5Type.Message</string>
-                            <string>Message</string>
-                            <string>N_</string>
+                            <string>translateString</string>
                             <string>sortByIntIndex</string>
                             <string>_getattr_</string>
                             <string>context</string>
@@ -360,6 +358,12 @@ return line_list\n
             <key> <string>id</string> </key>
             <value> <string>PaySheetTransaction_getEditableObjectLineList</string> </value>
         </item>
+        <item>
+            <key> <string>uid</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
         <item>
             <key> <string>warnings</string> </key>
             <value>
diff --git a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getMovementList.xml b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getMovementList.xml
index 8a4b534680c..bb42dd28c77 100644
--- a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getMovementList.xml
+++ b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getMovementList.xml
@@ -75,8 +75,7 @@
 \n
 from Products.ERP5Type.Utils import cartesianProduct\n
 import pprint\n
-from Products.ERP5Type.Message import Message\n
-N_ = lambda msg, **kw: Message(\'erp5_ui\', msg, **kw)\n
+from Products.ERP5Type.Message import translateString\n
 \n
 portal = context.getPortalObject();\n
 paysheet_line_list = context.contentValues(portal_type=\'Pay Sheet Line\')\n
@@ -91,7 +90,7 @@ line_list = []\n
 for paysheet_line in paysheet_line_list:\n
   base_category_list = paysheet_line.getVariationBaseCategoryList()\n
   base_application_list = paysheet_line.getBaseAmountTitleList()\n
-  translated_base_application_list = [str(N_(x)) for x in base_application_list]\n
+  translated_base_application_list = [str(translateString(x)) for x in base_application_list]\n
   base_application_list = \', \'.join(translated_base_application_list)\n
   payroll_service = paysheet_line.getResourceValue(portal_type=\'Payroll Service\')\n
   if payroll_service is not None:\n
@@ -100,7 +99,7 @@ for paysheet_line in paysheet_line_list:\n
     base_participation_list = []\n
   causality = paysheet_line.getCausality()\n
 \n
-  base_list = [str(N_(base_application)) for base_application in \\\n
+  base_list = [str(translateString(base_application)) for base_application in \\\n
       paysheet_line.getBaseAmountTitleList()]\n
   base_name = \'+\'.join(base_list)\n
 \n
@@ -257,8 +256,7 @@ return line_list\n
                             <string>cartesianProduct</string>
                             <string>pprint</string>
                             <string>Products.ERP5Type.Message</string>
-                            <string>Message</string>
-                            <string>N_</string>
+                            <string>translateString</string>
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>portal</string>
@@ -326,6 +324,12 @@ return line_list\n
             <key> <string>id</string> </key>
             <value> <string>PaySheetTransaction_getMovementList</string> </value>
         </item>
+        <item>
+            <key> <string>uid</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
         <item>
             <key> <string>warnings</string> </key>
             <value>
diff --git a/bt5/erp5_payroll/bt/change_log b/bt5/erp5_payroll/bt/change_log
index 517d1dc0236..884e0964dd9 100644
--- a/bt5/erp5_payroll/bt/change_log
+++ b/bt5/erp5_payroll/bt/change_log
@@ -1,3 +1,6 @@
+2008-08-28 yusei
+* Use Base_translateString or translateString instead of N_ for translation message.
+
 2008-06-10 jerome
 * Add Payroll Taxes Report
 
diff --git a/bt5/erp5_payroll/bt/revision b/bt5/erp5_payroll/bt/revision
index 3c7d064c14f..cb28afbd3c6 100644
--- a/bt5/erp5_payroll/bt/revision
+++ b/bt5/erp5_payroll/bt/revision
@@ -1 +1 @@
-312
\ No newline at end of file
+313
\ No newline at end of file
-- 
2.30.9