Commit 84027e67 authored by Yusei Tahara's avatar Yusei Tahara

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@23255 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f9df2f96
...@@ -65,13 +65,12 @@ ...@@ -65,13 +65,12 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Message import Message\n <value> <string>from Products.ERP5Type.Message import translateString\n
N_ = lambda msg: Message(\'erp5_ui\', msg)\n
\n \n
return [\n return [\n
( N_(\'Tasks\'), \'Project_viewTaskList\'),\n (translateString(\'Tasks\'), \'Project_viewTaskList\'),\n
( N_(\'Tasks Reports\'), \'Project_viewTaskReportList\' ),\n (translateString(\'Tasks Reports\'), \'Project_viewTaskReportList\' ),\n
( N_(\'Tasks Summary\'), \'Project_viewSummaryList\'),\n (translateString(\'Tasks Summary\'), \'Project_viewSummaryList\'),\n
]\n ]\n
</string> </value> </string> </value>
</item> </item>
...@@ -116,8 +115,7 @@ return [\n ...@@ -116,8 +115,7 @@ return [\n
<value> <value>
<tuple> <tuple>
<string>Products.ERP5Type.Message</string> <string>Products.ERP5Type.Message</string>
<string>Message</string> <string>translateString</string>
<string>N_</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -136,6 +134,12 @@ return [\n ...@@ -136,6 +134,12 @@ return [\n
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Project_getExportModeItemList</string> </value> <value> <string>Project_getExportModeItemList</string> </value>
</item> </item>
<item>
<key> <string>uid</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
<value> <value>
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
from Products.ERP5Type.DateUtils import addToDate\n from Products.ERP5Type.DateUtils import addToDate\n
N_ = context.Base_translateString\n Base_translateString = context.Base_translateString\n
\n \n
task_portal_type = \'Task\'\n task_portal_type = \'Task\'\n
task_module = context.getDefaultModule(task_portal_type)\n task_module = context.getDefaultModule(task_portal_type)\n
...@@ -125,8 +125,8 @@ start_date = context.getStartDate()\n ...@@ -125,8 +125,8 @@ start_date = context.getStartDate()\n
if start_date is None:\n if start_date is None:\n
return context.REQUEST.RESPONSE.redirect(\n return context.REQUEST.RESPONSE.redirect(\n
\'%s?portal_status_message=%s+%s.\' % (context.absolute_url(), \n \'%s?portal_status_message=%s+%s.\' % (context.absolute_url(), \n
N_(\'Tasks+can+not+be+created:\'), \n Base_translateString(\'Tasks+can+not+be+created:\'), \n
N_(\'Start+Date+is+None\')))\n Base_translateString(\'Start+Date+is+None\')))\n
else:\n else:\n
date_list = getDatePeriodList(start_date)\n date_list = getDatePeriodList(start_date)\n
for next_date in date_list:\n for next_date in date_list:\n
...@@ -134,7 +134,7 @@ else:\n ...@@ -134,7 +134,7 @@ else:\n
return context.REQUEST.RESPONSE.redirect(\n return context.REQUEST.RESPONSE.redirect(\n
\'%s?portal_status_message=%s+%s.\' % (context.absolute_url(), \n \'%s?portal_status_message=%s+%s.\' % (context.absolute_url(), \n
len(date_list), \n len(date_list), \n
N_(\'Tasks+created\')))\n Base_translateString(\'Tasks+created\')))\n
]]></string> </value> ]]></string> </value>
...@@ -189,7 +189,7 @@ else:\n ...@@ -189,7 +189,7 @@ else:\n
<string>addToDate</string> <string>addToDate</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>N_</string> <string>Base_translateString</string>
<string>task_portal_type</string> <string>task_portal_type</string>
<string>task_module</string> <string>task_module</string>
<string>validateDay</string> <string>validateDay</string>
...@@ -227,6 +227,12 @@ else:\n ...@@ -227,6 +227,12 @@ else:\n
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Task_calculateDuplication</string> </value> <value> <string>Task_calculateDuplication</string> </value>
</item> </item>
<item>
<key> <string>uid</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
<value> <value>
......
2008-08-28 yusei
* Use Base_translateString or translateString instead of N_ for translation message.
2008-06-13 yusei 2008-06-13 yusei
* Removed unused action in Project type information. * Removed unused action in Project type information.
......
575 576
\ No newline at end of file \ No newline at end of file
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>def getModuleActionInformationDict(**kw):\n <value> <string>def getModuleActionInformationDict(**kw):\n
N_ = context.Base_translateString\n Base_translateString = context.Base_translateString\n
result_dict = {}\n result_dict = {}\n
\n \n
# If the user is not allowed to get the category, return immediately.\n # If the user is not allowed to get the category, return immediately.\n
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
form_id=form_id,\n form_id=form_id,\n
selection_name=selection_name,\n selection_name=selection_name,\n
select_action=action))\n select_action=action))\n
module_add_list.append((N_(content_type), url))\n module_add_list.append((Base_translateString(content_type), url))\n
for template in module.getDocumentTemplateList():\n for template in module.getDocumentTemplateList():\n
action = \'template %s\' % template.getRelativeUrl()\n action = \'template %s\' % template.getRelativeUrl()\n
url = renderCustomLink(\'%s/Base_doAction\' % module_url,\n url = renderCustomLink(\'%s/Base_doAction\' % module_url,\n
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
form_id=form_id,\n form_id=form_id,\n
selection_name=selection_name,\n selection_name=selection_name,\n
select_action=action))\n select_action=action))\n
template_name = N_(\'${template_title} (Template)\',\n template_name = Base_translateString(\'${template_title} (Template)\',\n
mapping=dict(template_title=template.getTitle()))\n mapping=dict(template_title=template.getTitle()))\n
module_add_list.append((template_name, url))\n module_add_list.append((template_name, url))\n
for add_action in action_dict.get(\'object_add\', ()):\n for add_action in action_dict.get(\'object_add\', ()):\n
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
form_id=form_id,\n form_id=form_id,\n
selection_name=selection_name,\n selection_name=selection_name,\n
select_action=action))\n select_action=action))\n
module_add_list.append((N_(add_action[\'name\']), url))\n module_add_list.append((Base_translateString(add_action[\'name\']), url))\n
if module_add_list:\n if module_add_list:\n
add_list.append((translated_title, module_add_list))\n add_list.append((translated_title, module_add_list))\n
\n \n
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
form_id=form_id,\n form_id=form_id,\n
selection_name=selection_name,\n selection_name=selection_name,\n
dialog_category=\'object_search\')).strip()\n dialog_category=\'object_search\')).strip()\n
module_search_list.append((N_(search_action[\'name\']), url))\n module_search_list.append((Base_translateString(search_action[\'name\']), url))\n
if module_search_list:\n if module_search_list:\n
search_list.append((translated_title, module_search_list))\n search_list.append((translated_title, module_search_list))\n
\n \n
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
form_id=form_id,\n form_id=form_id,\n
selection_name=selection_name,\n selection_name=selection_name,\n
dialog_category=\'object_exchange\')).strip()\n dialog_category=\'object_exchange\')).strip()\n
module_exchange_list.append((N_(exchange_action[\'name\']), url))\n module_exchange_list.append((Base_translateString(exchange_action[\'name\']), url))\n
if module_exchange_list:\n if module_exchange_list:\n
exchange_list.append((translated_title, module_exchange_list))\n exchange_list.append((translated_title, module_exchange_list))\n
\n \n
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
form_id=form_id,\n form_id=form_id,\n
selection_name=selection_name,\n selection_name=selection_name,\n
dialog_category=\'object_report\')).strip()\n dialog_category=\'object_report\')).strip()\n
module_report_list.append((N_(report_action[\'name\']), url))\n module_report_list.append((Base_translateString(report_action[\'name\']), url))\n
if module_report_list:\n if module_report_list:\n
report_list.append((translated_title, module_report_list))\n report_list.append((translated_title, module_report_list))\n
\n \n
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
form_id=form_id,\n form_id=form_id,\n
selection_name=selection_name,\n selection_name=selection_name,\n
dialog_category=\'object_print\')).strip()\n dialog_category=\'object_print\')).strip()\n
module_print_list.append((N_(print_action[\'name\']), url))\n module_print_list.append((Base_translateString(print_action[\'name\']), url))\n
if module_print_list:\n if module_print_list:\n
print_list.append((translated_title, module_print_list))\n print_list.append((translated_title, module_print_list))\n
\n \n
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>N_ = context.Base_translateString\n <value> <string>Base_translateString = context.Base_translateString\n
REQUEST = context.REQUEST\n REQUEST = context.REQUEST\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
contribute_file = REQUEST.get(\'contribute_file\', None)\n contribute_file = REQUEST.get(\'contribute_file\', None)\n
...@@ -75,7 +75,7 @@ contribute_portal_type = REQUEST.get(\'contribute_portal_type\', None)\n ...@@ -75,7 +75,7 @@ contribute_portal_type = REQUEST.get(\'contribute_portal_type\', None)\n
\n \n
\n \n
if contribute_file is None or not contribute_file.filename:\n if contribute_file is None or not contribute_file.filename:\n
portal_status_message = N_(\'Please select upload file.\')\n portal_status_message = Base_translateString(\'Please select upload file.\')\n
keep_items={\'portal_status_message\':portal_status_message}\n keep_items={\'portal_status_message\':portal_status_message}\n
portal.Base_redirect(form_view=\'view\', keep_items=keep_items)\n portal.Base_redirect(form_view=\'view\', keep_items=keep_items)\n
return\n return\n
...@@ -132,7 +132,7 @@ return context.ERP5Site_contributeContent(\n ...@@ -132,7 +132,7 @@ return context.ERP5Site_contributeContent(\n
<string>kw</string> <string>kw</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>N_</string> <string>Base_translateString</string>
<string>REQUEST</string> <string>REQUEST</string>
<string>portal</string> <string>portal</string>
<string>None</string> <string>None</string>
...@@ -160,6 +160,12 @@ return context.ERP5Site_contributeContent(\n ...@@ -160,6 +160,12 @@ return context.ERP5Site_contributeContent(\n
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ERP5Site_uploadContributeContent</string> </value> <value> <string>ERP5Site_uploadContributeContent</string> </value>
</item> </item>
<item>
<key> <string>uid</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
<value> <value>
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n Base_translateString = portal.Base_translateString\n
preserved_parameters={\'form_id\': form_id, \'cancel_url\': cancel_url}\n preserved_parameters={\'form_id\': form_id, \'cancel_url\': cancel_url}\n
request = context.REQUEST\n request = context.REQUEST\n
\n \n
...@@ -101,7 +101,7 @@ elif doAction0 == \'add\':\n ...@@ -101,7 +101,7 @@ elif doAction0 == \'add\':\n
new_content = context.newContent(portal_type=type_name,\n new_content = context.newContent(portal_type=type_name,\n
container=context,\n container=context,\n
id=str(new_id))\n id=str(new_id))\n
preserved_parameters[\'portal_status_message\'] = N_("Object Created.")\n preserved_parameters[\'portal_status_message\'] = Base_translateString("Object Created.")\n
preserved_parameters[\'editable_mode\'] = 1\n preserved_parameters[\'editable_mode\'] = 1\n
redirect_url = \'%s/view\' % (new_content.absolute_url(), )\n redirect_url = \'%s/view\' % (new_content.absolute_url(), )\n
# The created object is not a part of the selection, so prevent from displaying the selection navigation controls\n # The created object is not a part of the selection, so prevent from displaying the selection navigation controls\n
...@@ -118,14 +118,14 @@ elif doAction0 == \'template\':\n ...@@ -118,14 +118,14 @@ elif doAction0 == \'template\':\n
new_content_id = new_content_list[0][\'new_id\']\n new_content_id = new_content_list[0][\'new_id\']\n
new_content = context[new_content_id]\n new_content = context[new_content_id]\n
new_content.makeTemplateInstance()\n new_content.makeTemplateInstance()\n
preserved_parameters[\'portal_status_message\'] = N_("Template Created.")\n preserved_parameters[\'portal_status_message\'] = Base_translateString("Template Created.")\n
redirect_url = \'%s/view\' % ( new_content.absolute_url(), )\n redirect_url = \'%s/view\' % ( new_content.absolute_url(), )\n
else:\n else:\n
preserved_parameters[\'portal_status_message\'] = N_("Template Does not Exist.")\n preserved_parameters[\'portal_status_message\'] = Base_translateString("Template Does not Exist.")\n
redirect_url = \'%s/view\' % (context.absolute_url(), )\n redirect_url = \'%s/view\' % (context.absolute_url(), )\n
else:\n else:\n
redirect_url = request[\'ACTUAL_URL\']\n redirect_url = request[\'ACTUAL_URL\']\n
preserved_parameters[\'portal_status_message\'] = N_(\'Error: the action "%s" is not recognised.\' % (doAction0, ))\n preserved_parameters[\'portal_status_message\'] = Base_translateString(\'Error: the action "%s" is not recognised.\' % (doAction0, ))\n
\n \n
return context.ERP5Site_redirect(redirect_url, keep_items=preserved_parameters, **kw)\n return context.ERP5Site_redirect(redirect_url, keep_items=preserved_parameters, **kw)\n
</string> </value> </string> </value>
...@@ -183,7 +183,7 @@ return context.ERP5Site_redirect(redirect_url, keep_items=preserved_parameters, ...@@ -183,7 +183,7 @@ return context.ERP5Site_redirect(redirect_url, keep_items=preserved_parameters,
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal</string> <string>portal</string>
<string>N_</string> <string>Base_translateString</string>
<string>preserved_parameters</string> <string>preserved_parameters</string>
<string>request</string> <string>request</string>
<string>None</string> <string>None</string>
...@@ -227,6 +227,12 @@ return context.ERP5Site_redirect(redirect_url, keep_items=preserved_parameters, ...@@ -227,6 +227,12 @@ return context.ERP5Site_redirect(redirect_url, keep_items=preserved_parameters,
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Base_doAction</string> </value> <value> <string>Base_doAction</string> </value>
</item> </item>
<item>
<key> <string>uid</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
<value> <value>
......
...@@ -65,16 +65,16 @@ ...@@ -65,16 +65,16 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>N_ = context.getPortalObject().Base_translateString\n <value> <string>Base_translateString = context.getPortalObject().Base_translateString\n
allowed_type_list = context.getVisibleAllowedContentTypeList()\n allowed_type_list = context.getVisibleAllowedContentTypeList()\n
\n \n
if not allowed_type_list:\n if not allowed_type_list:\n
return context.ERP5Site_redirect(\'%s/view\' % (context.absolute_url(), ), keep_items={\'portal_status_message\': N_("You are not allowed to add new content in this context.")})\n return context.ERP5Site_redirect(\'%s/view\' % (context.absolute_url(), ), keep_items={\'portal_status_message\': Base_translateString("You are not allowed to add new content in this context.")})\n
\n \n
# newContent will add the first allowed type when we do not specify portal_type=\n # newContent will add the first allowed type when we do not specify portal_type=\n
new_object = context.newContent(portal_type=allowed_type_list[0])\n new_object = context.newContent(portal_type=allowed_type_list[0])\n
\n \n
return context.ERP5Site_redirect(\'%s/view\' % (new_object.absolute_url(), ), keep_items={\'portal_status_message\': N_("Object Created.")})\n return context.ERP5Site_redirect(\'%s/view\' % (new_object.absolute_url(), ), keep_items={\'portal_status_message\': Base_translateString("Object Created.")})\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -125,7 +125,7 @@ return context.ERP5Site_redirect(\'%s/view\' % (new_object.absolute_url(), ), ke ...@@ -125,7 +125,7 @@ return context.ERP5Site_redirect(\'%s/view\' % (new_object.absolute_url(), ), ke
<tuple> <tuple>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>N_</string> <string>Base_translateString</string>
<string>allowed_type_list</string> <string>allowed_type_list</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>new_object</string> <string>new_object</string>
...@@ -147,6 +147,12 @@ return context.ERP5Site_redirect(\'%s/view\' % (new_object.absolute_url(), ), ke ...@@ -147,6 +147,12 @@ return context.ERP5Site_redirect(\'%s/view\' % (new_object.absolute_url(), ), ke
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Folder_create</string> </value> <value> <string>Folder_create</string> </value>
</item> </item>
<item>
<key> <string>uid</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
<value> <value>
......
...@@ -67,8 +67,7 @@ ...@@ -67,8 +67,7 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.Formulator.Errors import FormValidationError\n <value> <string>from Products.Formulator.Errors import FormValidationError\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n from Products.ERP5Type.Message import translateString\n
N_ = lambda msg, **kwd: Message(\'erp5_ui\', msg, **kwd)\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
request=context.REQUEST\n request=context.REQUEST\n
\n \n
...@@ -136,7 +135,7 @@ except ValidationFailed, error_message:\n ...@@ -136,7 +135,7 @@ except ValidationFailed, error_message:\n
\'%s/%s\' % (context.absolute_url(), form_id),\n \'%s/%s\' % (context.absolute_url(), form_id),\n
keep_items={\'portal_status_message\': message}, **kw)\n keep_items={\'portal_status_message\': message}, **kw)\n
\n \n
portal_status_message = request.get(\'portal_status_message\', N_(\'Status changed.\'))\n portal_status_message = request.get(\'portal_status_message\', translateString(\'Status changed.\'))\n
\n \n
return context.ERP5Site_redirect(\n return context.ERP5Site_redirect(\n
\'%s/%s\' % (context.absolute_url(), form_id),\n \'%s/%s\' % (context.absolute_url(), form_id),\n
...@@ -197,8 +196,7 @@ return context.ERP5Site_redirect(\n ...@@ -197,8 +196,7 @@ return context.ERP5Site_redirect(\n
<string>Products.DCWorkflow.DCWorkflow</string> <string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string> <string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string> <string>Products.ERP5Type.Message</string>
<string>Message</string> <string>translateString</string>
<string>N_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal</string> <string>portal</string>
...@@ -247,6 +245,12 @@ return context.ERP5Site_redirect(\n ...@@ -247,6 +245,12 @@ return context.ERP5Site_redirect(\n
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Workflow_statusModify</string> </value> <value> <string>Workflow_statusModify</string> </value>
</item> </item>
<item>
<key> <string>uid</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
<value> <value>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment