Commit f9df2f96 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@23252 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2a501c41
...@@ -65,8 +65,7 @@ ...@@ -65,8 +65,7 @@
</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, **kw: Message(\'erp5_ui\', msg, **kw)\n
\n \n
if id and id != context.getId():\n if id and id != context.getId():\n
container = context.getParentValue()\n container = context.getParentValue()\n
...@@ -80,13 +79,13 @@ if id and id != context.getId():\n ...@@ -80,13 +79,13 @@ if id and id != context.getId():\n
keep_items=dict(selection_name=selection_name,\n keep_items=dict(selection_name=selection_name,\n
selection_index=selection_index,\n selection_index=selection_index,\n
cancel_url=cancel_url,\n cancel_url=cancel_url,\n
portal_status_message=N_("Function Changed")),)\n portal_status_message=translateString("Function Changed")),)\n
\n \n
return context.Base_redirect(form_id,\n return context.Base_redirect(form_id,\n
keep_items=dict(selection_name=selection_name,\n keep_items=dict(selection_name=selection_name,\n
selection_index=selection_index,\n selection_index=selection_index,\n
cancel_url=cancel_url,\n cancel_url=cancel_url,\n
portal_status_message=N_("Cancelled")),)\n portal_status_message=translateString("Cancelled")),)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -142,8 +141,7 @@ return context.Base_redirect(form_id,\n ...@@ -142,8 +141,7 @@ return context.Base_redirect(form_id,\n
<string>cancel_url</string> <string>cancel_url</string>
<string>kw</string> <string>kw</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>container</string> <string>container</string>
......
...@@ -73,7 +73,7 @@ string.\n ...@@ -73,7 +73,7 @@ string.\n
"""\n """\n
from DateTime import DateTime\n from DateTime import DateTime\n
from Products.ERP5Type.DateUtils import getIntervalBetweenDates\n from Products.ERP5Type.DateUtils import getIntervalBetweenDates\n
N_ = context.Base_translateString\n Base_translateString = context.Base_translateString\n
\n \n
birthday = context.getBirthday()\n birthday = context.getBirthday()\n
if birthday is None:\n if birthday is None:\n
...@@ -88,7 +88,7 @@ if year:\n ...@@ -88,7 +88,7 @@ if year:\n
return interval_dict[\'year\']\n return interval_dict[\'year\']\n
\n \n
# mapping contains year, month & day\n # mapping contains year, month & day\n
return N_("${year} Years Old", mapping=interval_dict)\n return Base_translateString("${year} Years Old", mapping=interval_dict)\n
]]></string> </value> ]]></string> </value>
...@@ -140,7 +140,7 @@ return N_("${year} Years Old", mapping=interval_dict)\n ...@@ -140,7 +140,7 @@ return N_("${year} Years Old", mapping=interval_dict)\n
<string>getIntervalBetweenDates</string> <string>getIntervalBetweenDates</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>N_</string> <string>Base_translateString</string>
<string>birthday</string> <string>birthday</string>
<string>None</string> <string>None</string>
<string>interval_dict</string> <string>interval_dict</string>
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.CMFActivity.Errors import ActivityPendingError\n <value> <string>from Products.CMFActivity.Errors import ActivityPendingError\n
N_ = context.Base_translateString\n Base_translateString = context.Base_translateString\n
\n \n
person = context\n person = context\n
career_list = []\n career_list = []\n
...@@ -77,7 +77,7 @@ if \'default_career\' in person.objectIds():\n ...@@ -77,7 +77,7 @@ if \'default_career\' in person.objectIds():\n
\n \n
if default_career is None:\n if default_career is None:\n
# No default career.\n # No default career.\n
message = N_(\'Current career must exist.\')\n message = Base_translateString(\'Current career must exist.\')\n
return context.Base_redirect(form_id=form_id,\n return context.Base_redirect(form_id=form_id,\n
selection_name=selection_name,\n selection_name=selection_name,\n
selection_index=selection_index,\n selection_index=selection_index,\n
...@@ -89,7 +89,7 @@ else:\n ...@@ -89,7 +89,7 @@ else:\n
try:\n try:\n
default_career.setId(new_id)\n default_career.setId(new_id)\n
except ActivityPendingError, error:\n except ActivityPendingError, error:\n
message = N_("%s" % error)\n message = Base_translateString("%s" % error)\n
return context.Base_redirect(form_id=form_id,\n return context.Base_redirect(form_id=form_id,\n
selection_name=selection_name,\n selection_name=selection_name,\n
selection_index=selection_index,\n selection_index=selection_index,\n
...@@ -107,7 +107,7 @@ else:\n ...@@ -107,7 +107,7 @@ else:\n
start_date=new_start_date,\n start_date=new_start_date,\n
stop_date=None)\n stop_date=None)\n
\n \n
message = N_(\'Last career step terminated. New career step added.\')\n message = Base_translateString(\'Last career step terminated. New career step added.\')\n
return context.Base_redirect(form_id=form_id,\n return context.Base_redirect(form_id=form_id,\n
selection_name=selection_name,\n selection_name=selection_name,\n
selection_index=selection_index,\n selection_index=selection_index,\n
...@@ -167,7 +167,7 @@ else:\n ...@@ -167,7 +167,7 @@ else:\n
<string>ActivityPendingError</string> <string>ActivityPendingError</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>N_</string> <string>Base_translateString</string>
<string>person</string> <string>person</string>
<string>career_list</string> <string>career_list</string>
<string>None</string> <string>None</string>
......
2008-08-28 yusei
* Use Base_translateString or translateString instead of N_ for translation message.
2008-08-15 jerome 2008-08-15 jerome
* Expose creation_date in Delivery_getODTDataDict * Expose creation_date in Delivery_getODTDataDict
......
409 410
\ No newline at end of file \ No newline at end of file
...@@ -113,8 +113,7 @@ event_kw[\'causality\'] = causality\n ...@@ -113,8 +113,7 @@ event_kw[\'causality\'] = causality\n
module = context.getDefaultModule(portal_type=portal_type)\n module = context.getDefaultModule(portal_type=portal_type)\n
event = module.newContent(**event_kw)\n event = module.newContent(**event_kw)\n
\n \n
N_ = context.Base_translateString\n message = context.Base_translateString(\'New Event Created\')\n
message = N_(\'New Event Created\')\n
\n \n
event.Base_redirect(keep_items={\'portal_status_message\': message})\n event.Base_redirect(keep_items={\'portal_status_message\': message})\n
</string> </value> </string> </value>
...@@ -196,7 +195,6 @@ event.Base_redirect(keep_items={\'portal_status_message\': message})\n ...@@ -196,7 +195,6 @@ event.Base_redirect(keep_items={\'portal_status_message\': message})\n
<string>module</string> <string>module</string>
<string>_apply_</string> <string>_apply_</string>
<string>event</string> <string>event</string>
<string>N_</string>
<string>message</string> <string>message</string>
</tuple> </tuple>
</value> </value>
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>dms_module = getattr(context, \'document_module\', None)\n <value> <string>dms_module = getattr(context, \'document_module\', None)\n
attachment_info_list = context.getAttachmentInformationList()\n attachment_info_list = context.getAttachmentInformationList()\n
N_ = context.Base_translateString\n Base_translateString = context.Base_translateString\n
if dms_module is not None:\n if dms_module is not None:\n
for uid in uids:\n for uid in uids:\n
# Maybe select Line can be improved later\n # Maybe select Line can be improved later\n
...@@ -88,12 +88,12 @@ if dms_module is not None:\n ...@@ -88,12 +88,12 @@ if dms_module is not None:\n
\n \n
if len(uids) == 1:\n if len(uids) == 1:\n
return context.REQUEST.RESPONSE.redirect(\n return context.REQUEST.RESPONSE.redirect(\n
\'%s/view?portal_status_message=%s+%s.\' % (doc.absolute_url(), doc.getTranslatedPortalType(),\n \'%s/view?portal_status_message=%s+%s.\' % (doc.absolute_url(), doc.getTranslatedPortalType(),\n
N_(\'+Created+Successfully\')))\n Base_translateString(\'+Created+Successfully\')))\n
\n \n
return context.REQUEST.RESPONSE.redirect(\n return context.REQUEST.RESPONSE.redirect(\n
\'%s?portal_status_message=%s+%s.\' % (dms_module.absolute_url(),len(uids),\n \'%s?portal_status_message=%s+%s.\' % (dms_module.absolute_url(),len(uids),\n
N_(\'+Documents+created+Successfully\')))\n Base_translateString(\'+Documents+created+Successfully\')))\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -151,7 +151,7 @@ return context.REQUEST.RESPONSE.redirect(\n ...@@ -151,7 +151,7 @@ return context.REQUEST.RESPONSE.redirect(\n
<string>dms_module</string> <string>dms_module</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>attachment_info_list</string> <string>attachment_info_list</string>
<string>N_</string> <string>Base_translateString</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>uid</string> <string>uid</string>
<string>_getitem_</string> <string>_getitem_</string>
......
2008-08-28 yusei
* Use Base_translateString or translateString instead of N_ for translation message.
2008-07-17 jerome 2008-07-17 jerome
Remove portal transforms, they are also in core Remove portal transforms, they are also in core
......
295 296
\ No newline at end of file \ No newline at end of file
...@@ -65,16 +65,14 @@ ...@@ -65,16 +65,14 @@
</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
N_ = lambda msg, **kw: str(Message(\'erp5_ui\', msg, **kw))\n
\n \n
packing_list = context\n packing_list = context\n
\n \n
# Modify state\n # Modify state\n
packing_list_state = packing_list.getSimulationState()\n packing_list_state = packing_list.getSimulationState()\n
if packing_list_state == "draft":\n if packing_list_state == "draft":\n
packing_list.confirm(comment=N_(\'Initialized by Delivery Builder\'))\n packing_list.confirm(comment=translateString(\'Initialized by Delivery Builder\'))\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -125,8 +123,7 @@ if packing_list_state == "draft":\n ...@@ -125,8 +123,7 @@ if packing_list_state == "draft":\n
<tuple> <tuple>
<string>kw</string> <string>kw</string>
<string>Products.ERP5Type.Message</string> <string>Products.ERP5Type.Message</string>
<string>Message</string> <string>translateString</string>
<string>N_</string>
<string>context</string> <string>context</string>
<string>packing_list</string> <string>packing_list</string>
<string>_getattr_</string> <string>_getattr_</string>
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
# and tries to complete some fields\n # and tries to complete some fields\n
\n \n
order = context\n order = context\n
N_ = context.Base_translateString\n Base_translateString = context.Base_translateString\n
trade_condition_portal_type = \'Purchase Trade Condition\'\n trade_condition_portal_type = \'Purchase Trade Condition\'\n
\n \n
trade_condition_list = order.getSpecialiseValueList(\n trade_condition_list = order.getSpecialiseValueList(\n
...@@ -97,7 +97,7 @@ while count > 0 and len(trade_condition_list) == 0:\n ...@@ -97,7 +97,7 @@ while count > 0 and len(trade_condition_list) == 0:\n
\n \n
if len(trade_condition_list ) == 0 :\n if len(trade_condition_list ) == 0 :\n
redirect_url = \'%s/%s?%s\' % ( context.absolute_url(), form_id,\n redirect_url = \'%s/%s?%s\' % ( context.absolute_url(), form_id,\n
\'portal_status_message=\' + N_(\'No Trade Condition.\'))\n \'portal_status_message=\' + Base_translateString(\'No Trade Condition.\'))\n
else :\n else :\n
# if more than one trade condition is found, simply apply the first one\n # if more than one trade condition is found, simply apply the first one\n
trade_condition=trade_condition_list[0].getObject()\n trade_condition=trade_condition_list[0].getObject()\n
...@@ -105,7 +105,7 @@ else :\n ...@@ -105,7 +105,7 @@ else :\n
order.Order_applyTradeCondition(trade_condition, force=force)\n order.Order_applyTradeCondition(trade_condition, force=force)\n
\n \n
redirect_url = \'%s/%s?%s\' % (context.absolute_url(), form_id,\n redirect_url = \'%s/%s?%s\' % (context.absolute_url(), form_id,\n
\'portal_status_message=\' + N_(\'Order updated.\'))\n \'portal_status_message=\' + Base_translateString(\'Order updated.\'))\n
\n \n
if batch_mode:\n if batch_mode:\n
return\n return\n
...@@ -166,7 +166,7 @@ context.REQUEST[ \'RESPONSE\' ].redirect( redirect_url.replace(\' \', \'+\') )\n ...@@ -166,7 +166,7 @@ context.REQUEST[ \'RESPONSE\' ].redirect( redirect_url.replace(\' \', \'+\') )\n
<string>context</string> <string>context</string>
<string>order</string> <string>order</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>N_</string> <string>Base_translateString</string>
<string>trade_condition_portal_type</string> <string>trade_condition_portal_type</string>
<string>trade_condition_list</string> <string>trade_condition_list</string>
<string>tested_base_category_list</string> <string>tested_base_category_list</string>
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
# and tries to complete some fields\n # and tries to complete some fields\n
\n \n
order = context\n order = context\n
N_ = context.Base_translateString\n Base_translateString = context.Base_translateString\n
trade_condition_portal_type = \'Sale Trade Condition\'\n trade_condition_portal_type = \'Sale Trade Condition\'\n
\n \n
trade_condition_list = order.getSpecialiseValueList(\n trade_condition_list = order.getSpecialiseValueList(\n
...@@ -97,7 +97,7 @@ while count > 0 and len(trade_condition_list) == 0:\n ...@@ -97,7 +97,7 @@ while count > 0 and len(trade_condition_list) == 0:\n
\n \n
if len(trade_condition_list ) == 0 :\n if len(trade_condition_list ) == 0 :\n
redirect_url = \'%s/%s?%s\' % ( context.absolute_url(), form_id,\n redirect_url = \'%s/%s?%s\' % ( context.absolute_url(), form_id,\n
\'portal_status_message=\' + N_(\'No Trade Condition.\'))\n \'portal_status_message=\' + Base_translateString(\'No Trade Condition.\'))\n
else :\n else :\n
# if more than one trade condition is found, simply apply the first one\n # if more than one trade condition is found, simply apply the first one\n
trade_condition=trade_condition_list[0].getObject()\n trade_condition=trade_condition_list[0].getObject()\n
...@@ -108,7 +108,7 @@ else :\n ...@@ -108,7 +108,7 @@ else :\n
context.setReceivedDate(DateTime())\n context.setReceivedDate(DateTime())\n
\n \n
redirect_url = \'%s/%s?%s\' % (context.absolute_url(), form_id,\n redirect_url = \'%s/%s?%s\' % (context.absolute_url(), form_id,\n
\'portal_status_message=\' + N_(\'Order updated.\'))\n \'portal_status_message=\' + Base_translateString(\'Order updated.\'))\n
\n \n
if batch_mode:\n if batch_mode:\n
return\n return\n
...@@ -169,7 +169,7 @@ context.REQUEST[ \'RESPONSE\' ].redirect( redirect_url.replace(\' \', \'+\') )\n ...@@ -169,7 +169,7 @@ context.REQUEST[ \'RESPONSE\' ].redirect( redirect_url.replace(\' \', \'+\') )\n
<string>context</string> <string>context</string>
<string>order</string> <string>order</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>N_</string> <string>Base_translateString</string>
<string>trade_condition_portal_type</string> <string>trade_condition_portal_type</string>
<string>trade_condition_list</string> <string>trade_condition_list</string>
<string>tested_base_category_list</string> <string>tested_base_category_list</string>
......
...@@ -68,9 +68,7 @@ ...@@ -68,9 +68,7 @@
<value> <string>if related_simulation_movement_path_list is None:\n <value> <string>if related_simulation_movement_path_list is None:\n
raise RuntimeError, \'related_simulation_movement_path_list is missing. Update ERP5 Product.\'\n raise RuntimeError, \'related_simulation_movement_path_list is missing. Update ERP5 Product.\'\n
\n \n
from Products.ERP5Type.Message import Message\n from Products.ERP5Type.Message import translateString\n
\n
N_ = lambda msg, **kw: str(Message(\'erp5_ui\', msg, **kw))\n
\n \n
packing_list = context\n packing_list = context\n
\n \n
...@@ -81,7 +79,7 @@ packing_list.PackingList_copyOrderProperties()\n ...@@ -81,7 +79,7 @@ packing_list.PackingList_copyOrderProperties()\n
packing_list_state = packing_list.getSimulationState()\n packing_list_state = packing_list.getSimulationState()\n
\n \n
if packing_list_state == "draft":\n if packing_list_state == "draft":\n
packing_list.confirm(comment=N_(\'Initialized by Delivery Builder\'))\n packing_list.confirm(comment=translateString(\'Initialized by Delivery Builder\'))\n
\n \n
# First set the packing_list in the building state\n # First set the packing_list in the building state\n
packing_list.startBuilding()\n packing_list.startBuilding()\n
...@@ -134,8 +132,7 @@ packing_list.activate(after_path_and_method_id=(related_simulation_movement_path ...@@ -134,8 +132,7 @@ packing_list.activate(after_path_and_method_id=(related_simulation_movement_path
<string>None</string> <string>None</string>
<string>RuntimeError</string> <string>RuntimeError</string>
<string>Products.ERP5Type.Message</string> <string>Products.ERP5Type.Message</string>
<string>Message</string> <string>translateString</string>
<string>N_</string>
<string>context</string> <string>context</string>
<string>packing_list</string> <string>packing_list</string>
<string>_getattr_</string> <string>_getattr_</string>
......
2008-08-28 yusei 2008-08-28 yusei
* Use N_ function for translation message. * Use Base_translateString or translateString instead of N_ for translation message.
2008-07-30 Jerome 2008-07-30 Jerome
Add "offered" and "rejected" state on order workflow, to manage offers. Add "offered" and "rejected" state on order workflow, to manage offers.
......
474 475
\ No newline at end of file \ No newline at end of file
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