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