Commit 1dd32b99 authored by Yusei Tahara's avatar Yusei Tahara

2008-08-28 yusei

* Use Base_translateString or translateString instead of N_.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23242 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent edb6d5d0
......@@ -226,7 +226,7 @@ if hasattr(kw, \'previous_md5_object_uid_list\'):\n
object_uid_list = map(lambda x:x.getObject().getUid(), selection_list)\n
error = context.portal_selections.selectionHasChanged(kw[\'previous_md5_object_uid_list\'], object_uid_list)\n
if error:\n
error_message = N_("Sorry+your+selection+has+changed")\n
error_message = context.Base_translateString("Sorry+your+selection+has+changed")\n
\n
# if dialog_category is object_search, then edit the selection\n
if dialog_category == "object_search" :\n
......@@ -387,7 +387,6 @@ return request.RESPONSE.redirect(redirect_url)\n
<string>map</string>
<string>object_uid_list</string>
<string>error</string>
<string>N_</string>
<string>listbox_uid</string>
<string>uids</string>
<string>selected_uids</string>
......
......@@ -68,25 +68,23 @@
<value> <string>"""Add an object of the same type as self in the container, unless\n
this type cannot be added in the container.\n
"""\n
N_ = context.getPortalObject().Base_translateString\n
Base_translateString = context.Base_translateString\n
REQUEST=context.REQUEST\n
parent = context.getParentValue()\n
allowed_type_list = parent.getVisibleAllowedContentTypeList()\n
\n
if not allowed_type_list:\n
return context.ERP5Site_redirect(\'%s/%s\' % (context.absolute_url(), form_id),\n
keep_items={\'portal_status_message\':\n
N_("You are not allowed to add new content in this context.")})\n
keep_items={\'portal_status_message\':Base_translateString("You are not allowed to add new content in this context.")})\n
\n
if context.getPortalType() not in allowed_type_list:\n
return context.ERP5Site_redirect(\'%s/%s\' % (context.absolute_url(), form_id),\n
keep_items={\'portal_status_message\':\n
N_("You are not allowed to add ${portal_type} in this context.",\n
keep_items={\'portal_status_message\':Base_translateString("You are not allowed to add ${portal_type} in this context.",\n
mapping=dict(portal_type=context.getTranslatedPortalType()))})\n
\n
new_content = parent.newContent(portal_type=context.getPortalType())\n
return context.ERP5Site_redirect(\'%s/%s\' % (new_content.absolute_url(), form_id),\n
keep_items={\'portal_status_message\': N_("Object Created.")})\n
keep_items={\'portal_status_message\':Base_translateString("Object Created.")})\n
</string> </value>
</item>
<item>
......@@ -138,7 +136,7 @@ return context.ERP5Site_redirect(\'%s/%s\' % (new_content.absolute_url(), form_i
<string>form_id</string>
<string>_getattr_</string>
<string>context</string>
<string>N_</string>
<string>Base_translateString</string>
<string>REQUEST</string>
<string>parent</string>
<string>allowed_type_list</string>
......
......@@ -70,7 +70,7 @@
context.Base_updateListboxSelection()\n
\n
portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
Base_translateString = portal.Base_translateString\n
\n
if not action_select : return\n
\n
......@@ -103,7 +103,7 @@ elif doAction0 == \'add\':\n
new_content = context.newContent(portal_type=type_name,\n
container=context,\n
id=str(new_id))\n
message = N_("Object+Created.")\n
message = Base_translateString("Object+Created.")\n
if not(ignore_layout) and context.getApplicableLayout():\n
redirect_url = \'%s/%s?portal_status_message=%s&editable_mode=1\' % (\n
new_content.WebSite_getDocumentPhysicalPath()\n
......@@ -130,7 +130,7 @@ elif doAction0 == \'template\':\n
, \'view\'\n
, \'portal_status_message=Template+Created.\')\n
else: \n
message = N_("Template+Does+not+Exist.")\n
message = Base_translateString("Template+Does+not+Exist.")\n
redirect_url = \'%s/%s?portal_status_message=%s\' % ( context.absolute_url()\n
, \'view\'\n
, message)\n
......@@ -193,7 +193,7 @@ return getattr(context,form_id)(request)\n
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>N_</string>
<string>Base_translateString</string>
<string>int</string>
<string>Base_doAction</string>
<string>_getitem_</string>
......
......@@ -81,7 +81,7 @@ from Products.CMFActivity.Errors import ActivityPendingError\n
\n
request=context.REQUEST\n
portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
Base_translateString = portal.Base_translateString\n
\n
# Extra security\n
if request.get(\'field_prefix\', None):\n
......@@ -95,7 +95,7 @@ if dialog_id not in (\'\', None):\n
# editing it by calling the Base_edit script with correct\n
# parameters directly.\n
if not silent_mode and not request.AUTHENTICATED_USER.has_permission(\'Modify portal content\', context) :\n
msg = N_(\'You don\\\'t have the permissions to edit the object.\')\n
msg = Base_translateString("You don\'t have the permissions to edit the object.")\n
redirect_url = \'%s/%s?selection_index=%s&selection_name=%s&%s\' % (context.absolute_url(), form_id, selection_index, selection_name, \'portal_status_message=%s\' % msg)\n
return request[\'RESPONSE\'].redirect(redirect_url)\n
\n
......@@ -234,7 +234,7 @@ def parseField(f):\n
kw = {}\n
encapsulated_editor_list = []\n
MARKER = []\n
message = N_("Data+Updated.")\n
message = Base_translateString("Data+Updated.")\n
\n
try:\n
# We process all the field in form and\n
......@@ -262,7 +262,7 @@ try:\n
for encapsulated_editor in encapsulated_editor_list:\n
encapsulated_editor.edit(context)\n
except ActivityPendingError,e:\n
message = N_("%s" % e)\n
message = Base_translateString("%s" % e)\n
\n
ignore_layout = int(ignore_layout)\n
editable_mode = int(editable_mode)\n
......@@ -353,7 +353,7 @@ return result\n
<string>context</string>
<string>request</string>
<string>portal</string>
<string>N_</string>
<string>Base_translateString</string>
<string>None</string>
<string>msg</string>
<string>redirect_url</string>
......
......@@ -72,7 +72,7 @@ from Products.CMFActivity.Errors import ActivityPendingError\n
\n
request=context.REQUEST\n
portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
Base_translateString = portal.Base_translateString\n
\n
# Extra security\n
if request.get(\'field_prefix\', None):\n
......@@ -105,7 +105,7 @@ except FormValidationError, validation_errors:\n
kw = {}\n
encapsulated_editor_list = []\n
MARKER = []\n
message = N_("Data+Updated.")\n
message = Base_translateString("Data+Updated.")\n
\n
\n
def parseField(f):\n
......@@ -139,7 +139,7 @@ try:\n
for encapsulated_editor in encapsulated_editor_list:\n
encapsulated_editor.edit(context)\n
except ActivityPendingError,e:\n
message = N_("%s" % e)\n
message = Base_translateString("%s" % e)\n
\n
ignore_layout = int(ignore_layout)\n
editable_mode = int(editable_mode)\n
......@@ -227,7 +227,7 @@ return request[\'RESPONSE\'].redirect(redirect_url)\n
<string>context</string>
<string>request</string>
<string>portal</string>
<string>N_</string>
<string>Base_translateString</string>
<string>None</string>
<string>getattr</string>
<string>form</string>
......
......@@ -67,15 +67,13 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
from Products.ERP5Type.Message import Message\n
from Products.ERP5Type.Message import translateString\n
from Products.ERP5Type.Document import newTempBase\n
from string import zfill\n
portal = context.getPortalObject()\n
request = context.REQUEST\n
domain_list = []\n
\n
N_ = lambda msg, **kw: str(Message(\'erp5_ui\', msg, **kw))\n
\n
selection_name = request.get(\'selection_name\')\n
params = portal.portal_selections.getSelectionParamsFor(selection_name, request)\n
\n
......@@ -111,11 +109,11 @@ if depth == 0:\n
else:\n
o.setProperty(\'delimiter_type\', 0)\n
\n
title = N_(\'${day_name} ${date}\',\n
mapping=dict(day_name=N_(current_date.Day()),\n
title = translateString(\'${day_name} ${date}\',\n
mapping=dict(day_name=translateString(current_date.Day()),\n
date=current_date.strftime(date_format)))\n
o.setProperty(\'title\', title)\n
tp = \'%s %s\' % (N_(current_date.Day()), str(current_date))\n
tp = \'%s %s\' % (translateString(current_date.Day()), str(current_date))\n
o.setProperty(\'tooltip\', tp)\n
\n
category_list.append(o)\n
......@@ -194,7 +192,7 @@ return domain_list\n
<string>parent</string>
<string>kw</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>translateString</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>string</string>
......@@ -204,7 +202,6 @@ return domain_list\n
<string>portal</string>
<string>request</string>
<string>domain_list</string>
<string>N_</string>
<string>selection_name</string>
<string>params</string>
<string>DateTime</string>
......@@ -242,6 +239,12 @@ return domain_list\n
<key> <string>id</string> </key>
<value> <string>Base_generateDayDomain</string> </value>
</item>
<item>
<key> <string>uid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
......
......@@ -70,12 +70,10 @@
# - Weeks always starts at 0H of the last Sunday and finish at 0h of\n
# the next sunday.\n
\n
from Products.ERP5Type.Message import Message\n
from Products.ERP5Type.Message import translateString\n
from Products.ERP5Type.Document import newTempBase\n
from string import zfill\n
\n
N_ = lambda msg, **kw: str(Message(\'erp5_ui\', msg, **kw))\n
\n
portal = context.getPortalObject()\n
request = context.REQUEST\n
domain_list = []\n
......@@ -122,13 +120,13 @@ if depth == 0:\n
else:\n
o.setProperty(\'delimiter_type\', 0)\n
\n
title = N_(\'${day_name} ${date}\',\n
mapping=dict(day_name=N_(current_date.Day()),\n
title = translateString(\'${day_name} ${date}\',\n
mapping=dict(day_name=translateString(current_date.Day()),\n
date=current_date.strftime(date_format)))\n
o.setProperty(\'title\', title)\n
\n
# Defining ToolTip (Optional)\n
tp = \'%s %s\' % (N_(current_date.Day()), str(current_date))\n
tp = \'%s %s\' % (translateString(current_date.Day()), str(current_date))\n
o.setProperty(\'tooltip\', tp)\n
\n
# Defining Link (Optional)\n
......@@ -209,12 +207,11 @@ return domain_list\n
<string>parent</string>
<string>kw</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>translateString</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>string</string>
<string>zfill</string>
<string>N_</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
......@@ -261,6 +258,12 @@ return domain_list\n
<key> <string>id</string> </key>
<value> <string>Base_generateWeekDomain</string> </value>
</item>
<item>
<key> <string>uid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
......
......@@ -70,12 +70,10 @@
# - Years always starts at 0h of the current year\'s first day and \n
# finish 0h of the next year\'s first day.\n
\n
from Products.ERP5Type.Message import Message\n
from Products.ERP5Type.Message import translateString\n
from Products.ERP5Type.Document import newTempBase\n
from string import zfill\n
\n
N_ = lambda msg, **kw: str(Message(\'erp5_ui\', msg, **kw))\n
\n
portal = context.getPortalObject()\n
request = context.REQUEST\n
domain_list = []\n
......@@ -120,8 +118,8 @@ if depth == 0:\n
\n
o.setProperty(\'relative_position\', int(current_date))\n
\n
title = N_(\'${month_name} ${year}\',\n
mapping=dict(month_name=N_(current_date.Month()),\n
title = translateString(\'${month_name} ${year}\',\n
mapping=dict(month_name=translateString(current_date.Month()),\n
year=str(current_date.year())))\n
o.setProperty(\'title\', title)\n
\n
......@@ -204,12 +202,11 @@ return domain_list\n
<string>parent</string>
<string>kw</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>translateString</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>string</string>
<string>zfill</string>
<string>N_</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
......@@ -257,6 +254,12 @@ return domain_list\n
<key> <string>id</string> </key>
<value> <string>Base_generateYearDomain</string> </value>
</item>
<item>
<key> <string>uid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
......
......@@ -65,13 +65,12 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Message import Message\n
N_ = lambda msg: Message(\'erp5_ui\', msg)\n
<value> <string>from Products.ERP5Type.Message import translateString\n
\n
return [\n
(\'\', \'\'),\n
( N_(\'List of Documents\'), \'list\'),\n
(N_(\'Default Print of each Document\'), \'list_view\'),\n
(translateString(\'List of Documents\'), \'list\'),\n
(translateString(\'Default Print of each Document\'), \'list_view\'),\n
]\n
</string> </value>
</item>
......@@ -122,8 +121,7 @@ return [\n
<value>
<tuple>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>N_</string>
<string>translateString</string>
</tuple>
</value>
</item>
......
......@@ -68,7 +68,7 @@
<value> <string># wf_id : the id of workflow. It can be string, list or tuple.\n
from Products.CMFCore.utils import getToolByName\n
\n
N_ = context.Base_translateString\n
Base_translateString = context.Base_translateString\n
\n
\n
if same_type(wf_id, []) or same_type(wf_id, ()):\n
......@@ -87,7 +87,7 @@ for wf_id in wf_id_list:\n
if state.title and state.id != \'deleted\':\n
if not state_dict.has_key(state.id):\n
# we hide states without titles\n
item_list.append((N_(state.title), state.id))\n
item_list.append((Base_translateString(state.title), state.id))\n
state_dict[state.id] = None\n
\n
return item_list\n
......@@ -148,7 +148,7 @@ return item_list\n
<string>getToolByName</string>
<string>_getattr_</string>
<string>context</string>
<string>N_</string>
<string>Base_translateString</string>
<string>same_type</string>
<string>wf_id_list</string>
<string>state_dict</string>
......
......@@ -66,12 +66,12 @@
<item>
<key> <string>_body</string> </key>
<value> <string>from ZTUtils import make_query\n
N_ = context.Base_translateString\n
Base_translateString = context.Base_translateString\n
checkPerm = context.portal_membership.checkPermission\n
\n
if jump_from_relative_url is None: \n
relation = context \n
else: \n
if jump_from_relative_url is None:\n
relation = context\n
else:\n
relation = context.getPortalObject().restrictedTraverse(jump_from_relative_url)\n
\n
# FIXME: performance problem getting *all* related documents URL is not scalable.\n
......@@ -89,9 +89,10 @@ if same_type(portal_type, \'\'):\n
relation_found = 0\n
if len(related_list) == 0:\n
url = context.absolute_url()\n
message = N_(\'No %s Related\' % portal_type[0],\n
default = unicode(N_(\'No ${portal_type} Related.\',\n
mapping = { \'portal_type\': N_(portal_type[0])}), \'utf8\'))\n
message = Base_translateString(\n
\'No %s Related\' % portal_type[0],\n
default = unicode(Base_translateString(\'No ${portal_type} Related.\',\n
mapping = { \'portal_type\': Base_translateString(portal_type[0])}), \'utf8\'))\n
\n
elif len(related_list) == 1:\n
relation_found = 1\n
......@@ -107,17 +108,17 @@ elif len(related_list) == 1:\n
else:\n
form_id = \'view\'\n
url = related_object.absolute_url()\n
message = N_(\n
message = Base_translateString(\n
# first, try to get a full translated message with portal types\n
"%s related to %s." % (related_object.getPortalType(), context.getPortalType()),\n
# if not found, fallback to generic translation\n
default = unicode(N_(\'${this_portal_type} related to ${that_portal_type} : ${that_title}.\',\n
default = unicode(Base_translateString(\'${this_portal_type} related to ${that_portal_type} : ${that_title}.\',\n
mapping={"this_portal_type" : related_object.getTranslatedPortalType(),\n
"that_portal_type" : context.getTranslatedPortalType(),\n
"that_title" : context.getTitleOrId() }), \'utf8\'))\n
else :\n
url = context.absolute_url()\n
message = N_("You are not authorized to view the related document.")\n
message = Base_translateString("You are not authorized to view the related document.")\n
relation_found = 0\n
\n
else:\n
......@@ -149,7 +150,7 @@ else:\n
related_object_list.append(obj)\n
if len(related_object_list) == 0 :\n
url = context.absolute_url()\n
message = N_("You are not authorized to view any related document.")\n
message = Base_translateString("You are not authorized to view any related document.")\n
relation_found = 0\n
else :\n
request=context.REQUEST\n
......@@ -230,7 +231,7 @@ return context.REQUEST[ \'RESPONSE\' ].redirect(redirect_url)\n
<string>make_query</string>
<string>_getattr_</string>
<string>context</string>
<string>N_</string>
<string>Base_translateString</string>
<string>checkPerm</string>
<string>None</string>
<string>relation</string>
......
......@@ -70,7 +70,7 @@
from Products.Formulator.Errors import ValidationError, FormValidationError\n
from ZTUtils import make_query\n
portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
Base_translateString = portal.Base_translateString\n
\n
request=context.REQUEST\n
\n
......@@ -254,7 +254,7 @@ except FormValidationError, validation_errors:\n
request.set(\'field_errors\', field_errors)\n
return form(request)\n
else:\n
message = N_(\'Relation+Unchanged.\')\n
message = Base_translateString(\'Relation+Unchanged.\')\n
\n
if redirect_url is None:\n
if not selection_index:\n
......@@ -328,7 +328,7 @@ request[ \'RESPONSE\' ].redirect( redirect_url )\n
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>N_</string>
<string>Base_translateString</string>
<string>request</string>
<string>None</string>
<string>base_category</string>
......
......@@ -66,7 +66,7 @@
<item>
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
Base_translateString = portal.Base_translateString\n
\n
selected_uids = context.portal_selections.updateSelectionCheckedUidList(selection_name,listbox_uid,uids)\n
uids = context.portal_selections.getSelectionCheckedUidsFor(selection_name)\n
......@@ -77,9 +77,9 @@ request=context.REQUEST\n
\n
if uids != []:\n
context.manage_copyObjects(uids=uids, REQUEST=request, RESPONSE=request.RESPONSE)\n
message = N_("Item(s)+Copied.")\n
message = Base_translateString("Item(s)+Copied.")\n
else:\n
message = N_("Please+select+one+or+more+items+to+copy+first.")\n
message = Base_translateString("Please+select+one+or+more+items+to+copy+first.")\n
return request.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?portal_status_message=%s\' % message)\n
</string> </value>
</item>
......@@ -136,7 +136,7 @@ return request.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?p
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>N_</string>
<string>Base_translateString</string>
<string>selected_uids</string>
<string>request</string>
<string>message</string>
......
......@@ -66,7 +66,7 @@
<item>
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
Base_translateString = portal.Base_translateString\n
\n
REQUEST=context.REQUEST\n
\n
......@@ -79,7 +79,7 @@ except IndexError:\n
# return only a portal_status_message if the IndexError is raised because\n
# there are no elemnts in context.allowedContentTypes()\n
if not context.allowedContentTypes():\n
message = N_("You are not allowed to add new content in this context.")\n
message = Base_translateString("You are not allowed to add new content in this context.")\n
return REQUEST.RESPONSE.redirect(\'%s?portal_status_message=%s\' % (context.absolute_url(), message))\n
else:\n
raise\n
......@@ -132,7 +132,7 @@ return REQUEST.RESPONSE.redirect(url)\n
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>N_</string>
<string>Base_translateString</string>
<string>REQUEST</string>
<string>new_object</string>
<string>IndexError</string>
......
......@@ -68,7 +68,7 @@
<value> <string encoding="cdata"><![CDATA[
portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
Base_translateString = portal.Base_translateString\n
\n
def Object_hasRelation(object):\n
# Check if there is some related objets.\n
......@@ -101,16 +101,16 @@ if uids != []:\n
\n
if object_used > 0:\n
if object_used == 1:\n
message = N_("Sorry,+1+Item+Is+In+Use.")\n
message = Base_translateString("Sorry,+1+Item+Is+In+Use.")\n
else:\n
message = N_("Sorry,+${count}+Items+Are+In+Use.",\n
message = Base_translateString("Sorry,+${count}+Items+Are+In+Use.",\n
mapping={\'count\': repr(object_used)})\n
qs = \'?portal_status_message=%s\' % message \n
else:\n
context.manage_cutObjects(uids=uids, REQUEST=request)\n
message = N_("Item(s)+Cut.")\n
message = Base_translateString("Item(s)+Cut.")\n
else:\n
message = N_("Please+select+one+or+more+items+to+cut+first.")\n
message = Base_translateString("Please+select+one+or+more+items+to+cut+first.")\n
return request.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?portal_status_message=%s\' % message)\n
......@@ -163,7 +163,7 @@ return request.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?p
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>N_</string>
<string>Base_translateString</string>
<string>Object_hasRelation</string>
<string>selected_uids</string>
<string>request</string>
......
......@@ -69,13 +69,13 @@
from ZODB.POSException import ConflictError\n
portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
Base_translateString = portal.Base_translateString\n
\n
selected_uids = portal.portal_selections.updateSelectionCheckedUidList(\n
selection_name,listbox_uid,uids)\n
uids = portal.portal_selections.getSelectionCheckedUidsFor(selection_name)\n
\n
error = context.portal_selections.selectionHasChanged(md5_object_uid_list,\n
error = portal.portal_selections.selectionHasChanged(md5_object_uid_list,\n
uids)\n
\n
REQUEST=context.REQUEST\n
......@@ -101,7 +101,7 @@ def Object_hasRelation(obj):\n
\n
ret_url = context.absolute_url() + \'/\' + form_id\n
if error:\n
message = N_("Sorry+your+selection+has+changed")\n
message = Base_translateString("Sorry+your+selection+has+changed")\n
qs = \'?portal_status_message=%s\' % message\n
elif uids is not None:\n
# Check if there is some related objets.\n
......@@ -112,9 +112,9 @@ elif uids is not None:\n
\n
if object_used > 0:\n
if object_used == 1:\n
message = N_("Sorry,+1+Item+Is+In+Use.")\n
message = Base_translateString("Sorry,+1+Item+Is+In+Use.")\n
else:\n
message = N_("Sorry,+${count}+Items+Are+In+Use.",\n
message = Base_translateString("Sorry,+${count}+Items+Are+In+Use.",\n
mapping={\'count\': repr(object_used)})\n
qs = \'?portal_status_message=%s\' % message \n
else:\n
......@@ -137,11 +137,11 @@ elif uids is not None:\n
# Remove some objects\n
try:\n
if object_to_remove_list != []:\n
if context.portal_type==\'Preference\':\n
if portal.portal_type==\'Preference\':\n
context.manage_delObjects(\n
ids=[x.getId() for x in object_to_remove_list],\n
REQUEST=REQUEST)\n
context.portal_caches.clearCacheFactory(\'erp5_ui_medium\')\n
portal.portal_caches.clearCacheFactory(\'erp5_ui_medium\')\n
else:\n
context.manage_delObjects(\n
uids=[x.getUid() for x in object_to_remove_list],\n
......@@ -152,17 +152,15 @@ elif uids is not None:\n
qs = \'?portal_status_message=%s\' % message\n
else:\n
object_ids = [x.getId() for x in object_to_remove_list]\n
comment = N_(\'Deleted objects: ${object_ids}\',\n
comment = Base_translateString(\'Deleted objects: ${object_ids}\',\n
mapping={\'object_ids\': object_ids})\n
if \'edit_action\' in [x.get(\'id\', \'\') for x in\n
context.portal_workflow.getActionsFor(context)]:\n
portal.portal_workflow.getActionsFor(context)]:\n
# record object deletion in workflow history\n
context.getPortalObject().portal_workflow.doActionFor(\n
context,\n
\'edit_action\',\n
portal.portal_workflow.doActionFor(context, \'edit_action\',\n
comment=comment)\n
\n
message = N_("Deleted.")\n
message = Base_translateString("Deleted.")\n
\n
# Change workflow state of others objects\n
not_deleted_count = 0\n
......@@ -170,9 +168,7 @@ elif uids is not None:\n
# Hidden transition (without a message displayed) \n
# are not returned by getActionsFor\n
try:\n
context.getPortalObject().portal_workflow.doActionFor(\n
object,\n
\'delete_action\')\n
portal.portal_workflow.doActionFor(object, \'delete_action\')\n
except ConflictError:\n
raise\n
except:\n
......@@ -181,19 +177,19 @@ elif uids is not None:\n
\n
# Generate message\n
if not_deleted_count == 1:\n
message = N_("Sorry+You+Can+Not+Delete+${count}+Item.",\n
message = Base_translateString("Sorry+You+Can+Not+Delete+${count}+Item.",\n
mapping={\'count\': not_deleted_count})\n
elif not_deleted_count > 1:\n
message = N_("Sorry+You+Can+Not+Delete+${count}+Items.",\n
message = Base_translateString("Sorry+You+Can+Not+Delete+${count}+Items.",\n
mapping={\'count\': not_deleted_count})\n
qs = \'?portal_status_message=%s\' % message\n
\n
else:\n
message = N_("Please+select+one+or+more+items+first.")\n
message = Base_translateString("Please+select+one+or+more+items+first.")\n
qs = \'?portal_status_message=%s\' % message\n
\n
# make sure nothing is checked after\n
context.portal_selections.setSelectionCheckedUidsFor(selection_name, [])\n
portal.portal_selections.setSelectionCheckedUidsFor(selection_name, [])\n
return REQUEST.RESPONSE.redirect("%s%s" % (ret_url, qs))\n
......@@ -265,7 +261,7 @@ return REQUEST.RESPONSE.redirect("%s%s" % (ret_url, qs))\n
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>N_</string>
<string>Base_translateString</string>
<string>selected_uids</string>
<string>error</string>
<string>REQUEST</string>
......
......@@ -65,15 +65,14 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Message import Message\n
N_ = lambda msg: Message(\'erp5_ui\', msg)\n
<value> <string>from Products.ERP5Type.Message import translateString\n
\n
return [\n
(\'\', \'\'),\n
(N_(\'Logical Path\'), \'getCategoryChildTranslatedLogicalPathItemList\', ),\n
(N_(\'Logical Compact Path\'), \'getCategoryChildTranslatedCompactLogicalPathItemList\', ),\n
(N_(\'Indented Title\'), \'getCategoryChildTranslatedIndentedTitleItemList\', ),\n
(N_(\'Indented Compact Title\'), \'getCategoryChildTranslatedIndentedCompactTitleItemList\', ),\n
(translateString(\'Logical Path\'), \'getCategoryChildTranslatedLogicalPathItemList\', ),\n
(translateString(\'Logical Compact Path\'), \'getCategoryChildTranslatedCompactLogicalPathItemList\', ),\n
(translateString(\'Indented Title\'), \'getCategoryChildTranslatedIndentedTitleItemList\', ),\n
(translateString(\'Indented Compact Title\'), \'getCategoryChildTranslatedIndentedCompactTitleItemList\', ),\n
]\n
</string> </value>
</item>
......@@ -124,8 +123,7 @@ return [\n
<value>
<tuple>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>N_</string>
<string>translateString</string>
</tuple>
</value>
</item>
......
......@@ -66,12 +66,12 @@
<item>
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
Base_translateString = portal.Base_translateString\n
\n
item_list = [(\'\', \'\')]\n
\n
for skin_selection in portal.portal_skins.getSkinSelections():\n
item_list.append((N_("%s Style" % skin_selection), skin_selection))\n
item_list.append((Base_translateString("%s Style" % skin_selection), skin_selection))\n
\n
return item_list\n
</string> </value>
......@@ -125,7 +125,7 @@ return item_list\n
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>N_</string>
<string>Base_translateString</string>
<string>item_list</string>
<string>_getiter_</string>
<string>skin_selection</string>
......
2008-08-28 yusei
* Use N_ function for translation message.
* Use Base_translateString or translateString instead of N_.
2008-08-11 vincentd
* fix Base_jumpToRelatedObject to avoid a probleme with bad form_id when jumping on a single object
......
942
\ No newline at end of file
944
\ 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