[CMF-checkins] SVN: CMF/trunk/C - replaced user message strings by
MessageIDs
Yvo Schubbe
y.2005- at wcm-solutions.de
Thu Aug 11 12:34:28 EDT 2005
Log message for revision 37869:
- replaced user message strings by MessageIDs
Changed:
U CMF/trunk/CHANGES.txt
U CMF/trunk/CMFCalendar/__init__.py
U CMF/trunk/CMFCalendar/setuphandlers.py
U CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_form.py
A CMF/trunk/CMFCalendar/utils.py
U CMF/trunk/CMFCore/RegistrationTool.py
U CMF/trunk/CMFCore/utils.py
U CMF/trunk/CMFDefault/RegistrationTool.py
U CMF/trunk/CMFDefault/skins/zpt_content/document_edit_control.py
U CMF/trunk/CMFDefault/skins/zpt_content/document_edit_form.py
U CMF/trunk/CMFDefault/skins/zpt_content/file_edit_control.py
U CMF/trunk/CMFDefault/skins/zpt_content/file_edit_form.py
U CMF/trunk/CMFDefault/skins/zpt_content/folder_edit_control.py
U CMF/trunk/CMFDefault/skins/zpt_content/folder_edit_form.py
U CMF/trunk/CMFDefault/skins/zpt_content/full_metadata_edit_form.py
U CMF/trunk/CMFDefault/skins/zpt_content/image_edit_control.py
U CMF/trunk/CMFDefault/skins/zpt_content/image_edit_form.py
U CMF/trunk/CMFDefault/skins/zpt_content/link_edit_control.py
U CMF/trunk/CMFDefault/skins/zpt_content/link_edit_form.py
U CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_control.py
U CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_form.py
U CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_control.py
U CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_form.py
U CMF/trunk/CMFDefault/skins/zpt_control/folder_bottom_control.py
U CMF/trunk/CMFDefault/skins/zpt_control/folder_copy_control.py
U CMF/trunk/CMFDefault/skins/zpt_control/folder_cut_control.py
U CMF/trunk/CMFDefault/skins/zpt_control/folder_delete_control.py
U CMF/trunk/CMFDefault/skins/zpt_control/folder_down_control.py
U CMF/trunk/CMFDefault/skins/zpt_control/folder_paste_control.py
U CMF/trunk/CMFDefault/skins/zpt_control/folder_rename_control.py
U CMF/trunk/CMFDefault/skins/zpt_control/folder_top_control.py
U CMF/trunk/CMFDefault/skins/zpt_control/folder_up_control.py
U CMF/trunk/CMFDefault/skins/zpt_control/members_add_control.py
U CMF/trunk/CMFDefault/skins/zpt_control/members_delete_control.py
U CMF/trunk/CMFDefault/skins/zpt_control/portal_config_control.py
U CMF/trunk/CMFDefault/skins/zpt_control/validateId.py
U CMF/trunk/CMFDefault/skins/zpt_control/validateItemIds.py
U CMF/trunk/CMFDefault/skins/zpt_control/validateMemberIds.py
U CMF/trunk/CMFDefault/skins/zpt_control/validateType.py
U CMF/trunk/CMFDefault/skins/zpt_generic/breadcrumbs.py
U CMF/trunk/CMFDefault/skins/zpt_generic/folder_contents.py
U CMF/trunk/CMFDefault/skins/zpt_generic/folder_rename_form.py
U CMF/trunk/CMFDefault/skins/zpt_generic/join_form.py
U CMF/trunk/CMFDefault/skins/zpt_generic/members_delete_form.py
U CMF/trunk/CMFDefault/skins/zpt_generic/members_manage_form.py
U CMF/trunk/CMFDefault/skins/zpt_generic/reconfig_form.py
U CMF/trunk/CMFDefault/utils.py
-=-
Modified: CMF/trunk/CHANGES.txt
===================================================================
--- CMF/trunk/CHANGES.txt 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CHANGES.txt 2005-08-11 16:34:28 UTC (rev 37869)
@@ -2,6 +2,8 @@
New Features
+ - Replaced user messages by MassageIDs to improve the i18n support.
+
- CMFDefault CMFSetup profile: Added CMF BTree Folder to the list of
automatically instantiated types in the types tool.
(http://www.zope.org/Collectors/CMF/371)
Modified: CMF/trunk/CMFCalendar/__init__.py
===================================================================
--- CMF/trunk/CMFCalendar/__init__.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFCalendar/__init__.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -17,6 +17,7 @@
import sys
+import utils
from Products.CMFCore import utils
from Products.CMFCore.DirectoryView import registerDirectory
from Products.CMFSetup import EXTENSION
Modified: CMF/trunk/CMFCalendar/setuphandlers.py
===================================================================
--- CMF/trunk/CMFCalendar/setuphandlers.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFCalendar/setuphandlers.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -51,6 +51,7 @@
# Set up a MetadataTool element policy for events
try:
+ _ = str # MetadataTool ist not aware of MessageIDs
mdtool.addElementPolicy(
element='Subject',
content_type='Event',
@@ -58,8 +59,8 @@
supply_default=0,
default_value='',
enforce_vocabulary=0,
- allowed_vocabulary=('Appointment', 'Convention', 'Meeting',
- 'Social Event', 'Work'),
+ allowed_vocabulary=(_('Appointment'), _('Convention'),
+ _('Meeting'), _('Social Event'), _('Work')),
REQUEST=None)
except MetadataError:
pass
Modified: CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_form.py
===================================================================
--- CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_form.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_form.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,5 +1,7 @@
##parameters=change='', change_and_view=''
##
+from Products.CMFCalendar.utils import MessageID as _
+
form = context.REQUEST.form
if change and \
context.event_edit_control(**form) and \
@@ -15,8 +17,8 @@
buttons = []
target = context.getActionInfo('object/edit')['url']
-buttons.append( {'name': 'change', 'value': 'Change'} )
-buttons.append( {'name': 'change_and_view', 'value': 'Change and View'} )
+buttons.append( {'name': 'change', 'value': _('Change')} )
+buttons.append( {'name': 'change_and_view', 'value': _('Change and View')} )
options['form'] = { 'action': target,
'listButtonInfos': tuple(buttons) }
Added: CMF/trunk/CMFCalendar/utils.py
===================================================================
--- CMF/trunk/CMFCalendar/utils.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFCalendar/utils.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -0,0 +1,25 @@
+##############################################################################
+#
+# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+""" Utility functions.
+
+$Id$
+"""
+
+from AccessControl import ModuleSecurityInfo
+from zope.i18nmessageid import MessageIDFactory
+
+
+security = ModuleSecurityInfo('Products.CMFCalendar.utils')
+
+security.declarePublic('MessageID')
+MessageID = MessageIDFactory('cmf_calendar')
Property changes on: CMF/trunk/CMFCalendar/utils.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: CMF/trunk/CMFCore/RegistrationTool.py
===================================================================
--- CMF/trunk/CMFCore/RegistrationTool.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFCore/RegistrationTool.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -16,27 +16,27 @@
"""
import re
+from random import choice
+from AccessControl import ClassSecurityInfo
+from Globals import DTMLFile
from Globals import InitializeClass
-from Globals import DTMLFile
from OFS.SimpleItem import SimpleItem
-from AccessControl import ClassSecurityInfo
-from random import choice
from ActionProviderBase import ActionProviderBase
+from interfaces.portal_registration \
+ import portal_registration as IRegistrationTool
from permissions import AddPortalMember
from permissions import MailForgottenPassword
from permissions import ManagePortal
-from utils import UniqueObject
from utils import _checkPermission
+from utils import _dtmldir
from utils import _limitGrantedRoles
from utils import getToolByName
-from utils import _dtmldir
+from utils import MessageID as _
+from utils import UniqueObject
-from interfaces.portal_registration \
- import portal_registration as IRegistrationTool
-
class RegistrationTool(UniqueObject, SimpleItem, ActionProviderBase):
""" Create and modify users by making calls to portal_membership.
@@ -54,7 +54,7 @@
manage_options = (ActionProviderBase.manage_options +
({ 'label' : 'Overview', 'action' : 'manage_overview' }
- ,{ 'label' : 'Configure', 'action' : 'manage_configuration' }
+ ,{ 'label' : 'Configure', 'action' : 'manage_configuration' }
) + SimpleItem.manage_options)
#
@@ -138,8 +138,8 @@
detected before the fact so that a cleaner message can be printed.
'''
if not self.isMemberIdAllowed(id):
- raise ValueError('The login name you selected is already '
- 'in use or is not valid. Please choose another.')
+ raise ValueError(_('The login name you selected is already in '
+ 'use or is not valid. Please choose another.'))
failMessage = self.testPasswordValidity(password)
if failMessage is not None:
Modified: CMF/trunk/CMFCore/utils.py
===================================================================
--- CMF/trunk/CMFCore/utils.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFCore/utils.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -44,11 +44,13 @@
from OFS.SimpleItem import SimpleItem
from Products.PageTemplates.Expressions import getEngine
from Products.PageTemplates.Expressions import SecureModuleImporter
+from zope.i18nmessageid import MessageIDFactory
from exceptions import AccessControl_Unauthorized
from exceptions import NotFound
from warnings import warn
+
security = ModuleSecurityInfo( 'Products.CMFCore.utils' )
_dtmldir = os_path.join( package_home( globals() ), 'dtml' )
@@ -646,3 +648,7 @@
def __init__(self, **kw):
self.__dict__.update(kw)
+
+
+security.declarePublic('MessageID')
+MessageID = MessageIDFactory('cmf_default')
Modified: CMF/trunk/CMFDefault/RegistrationTool.py
===================================================================
--- CMF/trunk/CMFDefault/RegistrationTool.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/RegistrationTool.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -14,24 +14,25 @@
$Id$
"""
+
import re
-from Globals import InitializeClass, DTMLFile
from AccessControl import ClassSecurityInfo
+from Globals import InitializeClass
-from Products.CMFCore.utils import _checkPermission
-from Products.CMFCore.utils import getToolByName
from Products.CMFCore.ActionInformation import ActionInformation
from Products.CMFCore.Expression import Expression
-from Products.CMFCore.ActionProviderBase import ActionProviderBase
from Products.CMFCore.RegistrationTool import RegistrationTool as BaseTool
+from Products.CMFCore.utils import _checkPermission
+from Products.CMFCore.utils import getToolByName
from permissions import AddPortalMember
from permissions import ManagePortal
-from utils import _dtmldir
+from utils import MessageID as _
class RegistrationTool(BaseTool):
+
""" Manage through-the-web signup policies.
"""
@@ -65,14 +66,14 @@
o If not, return a string explaining why.
"""
if not password:
- return 'You must enter a password.'
+ return _('You must enter a password.')
if len(password) < 5 and not _checkPermission(ManagePortal, self):
- return 'Your password must contain at least 5 characters.'
+ return _('Your password must contain at least 5 characters.')
if confirm is not None and confirm != password:
- return ( 'Your password and confirmation did not match. '
- + 'Please try again.' )
+ return _('Your password and confirmation did not match. '
+ 'Please try again.')
return None
@@ -88,19 +89,19 @@
username = props.get('username', '')
if not username:
- return 'You must enter a valid name.'
+ return _('You must enter a valid name.')
if not self.isMemberIdAllowed(username):
- return ('The login name you selected is already '
- 'in use or is not valid. Please choose another.')
+ return _('The login name you selected is already in use or '
+ 'is not valid. Please choose another.')
email = props.get('email')
if email is None:
- return 'You must enter an email address.'
+ return _('You must enter an email address.')
ok, message = _checkEmail( email )
if not ok:
- return 'You must enter a valid email address.'
+ return _('You must enter a valid email address.')
else: # Existing member.
email = props.get('email')
@@ -109,13 +110,13 @@
ok, message = _checkEmail( email )
if not ok:
- return 'You must enter a valid email address.'
+ return _('You must enter a valid email address.')
# Not allowed to clear an existing non-empty email.
existing = member.getProperty('email')
-
+
if existing and email == '':
- return 'You must enter a valid email address.'
+ return _('You must enter a valid email address.')
return None
@@ -129,12 +130,13 @@
member = membership.getMemberById(forgotten_userid)
if member is None:
- raise ValueError('The username you entered could not be found.')
+ raise ValueError(_('The username you entered could not be '
+ 'found.'))
# assert that we can actually get an email address, otherwise
# the template will be made with a blank To:, this is bad
if not member.getProperty('email'):
- raise ValueError('That user does not have an email address.')
+ raise ValueError(_('That user does not have an email address.'))
check, msg = _checkEmail(member.getProperty('email'))
if not check:
@@ -162,7 +164,8 @@
member = membership.getMemberById( new_member_id )
if member is None:
- raise ValueError('The username you entered could not be found.')
+ raise ValueError(_('The username you entered could not be '
+ 'found.'))
if password is None:
password = member.getPassword()
@@ -170,12 +173,13 @@
email = member.getProperty( 'email' )
if email is None:
- raise ValueError( 'No email address is registered for member: %s'
- % new_member_id )
+ msg = _('No email address is registered for member: ${member_id}')
+ msg.mapping = {'member_id': new_member_id}
+ raise ValueError(msg)
check, msg = _checkEmail(email)
if not check:
- raise ValueError, msg
+ raise ValueError(msg)
# Rather than have the template try to use the mailhost, we will
# render the message ourselves and send it from here (where we
@@ -253,4 +257,3 @@
if matched != expected:
return False, message
return True, ''
-
Modified: CMF/trunk/CMFDefault/skins/zpt_content/document_edit_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/document_edit_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_content/document_edit_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -2,12 +2,13 @@
##
from Products.CMFDefault.exceptions import EditingConflict
from Products.CMFDefault.exceptions import ResourceLockedError
+from Products.CMFDefault.utils import MessageID as _
if text_format != context.text_format or text != context.text:
try:
context.edit(text_format, text, safety_belt=SafetyBelt)
- return context.setStatus(True, 'Document changed.')
+ return context.setStatus(True, _('Document changed.'))
except (ResourceLockedError, EditingConflict), errmsg:
return context.setStatus(False, errmsg)
else:
- return context.setStatus(False, 'Nothing to change.')
+ return context.setStatus(False, _('Nothing to change.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_content/document_edit_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/document_edit_form.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_content/document_edit_form.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,5 +1,7 @@
##parameters=change='', change_and_view=''
##
+from Products.CMFDefault.utils import MessageID as _
+
form = context.REQUEST.form
if change and \
context.validateTextFile(**form) and \
@@ -19,8 +21,8 @@
buttons = []
target = context.getActionInfo('object/edit')['url']
-buttons.append( {'name': 'change', 'value': 'Change'} )
-buttons.append( {'name': 'change_and_view', 'value': 'Change and View'} )
+buttons.append( {'name': 'change', 'value': _('Change')} )
+buttons.append( {'name': 'change_and_view', 'value': _('Change and View')} )
options['form'] = { 'action': target,
'listButtonInfos': tuple(buttons) }
Modified: CMF/trunk/CMFDefault/skins/zpt_content/file_edit_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/file_edit_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_content/file_edit_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,9 +1,10 @@
##parameters=file, **kw
##
from Products.CMFDefault.exceptions import ResourceLockedError
+from Products.CMFDefault.utils import MessageID as _
try:
context.edit(file=file)
- return context.setStatus(True, 'File changed.')
+ return context.setStatus(True, _('File changed.'))
except ResourceLockedError, errmsg:
return context.setStatus(False, errmsg)
Modified: CMF/trunk/CMFDefault/skins/zpt_content/file_edit_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/file_edit_form.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_content/file_edit_form.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,5 +1,7 @@
##parameters=change='', change_and_view=''
##
+from Products.CMFDefault.utils import MessageID as _
+
form = context.REQUEST.form
if change and \
context.file_edit_control(**form) and \
@@ -15,8 +17,8 @@
buttons = []
target = context.getActionInfo('object/edit')['url']
-buttons.append( {'name': 'change', 'value': 'Change'} )
-buttons.append( {'name': 'change_and_view', 'value': 'Change and View'} )
+buttons.append( {'name': 'change', 'value': _('Change')} )
+buttons.append( {'name': 'change_and_view', 'value': _('Change and View')} )
options['form'] = { 'action': target,
'listButtonInfos': tuple(buttons) }
Modified: CMF/trunk/CMFDefault/skins/zpt_content/folder_edit_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/folder_edit_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_content/folder_edit_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,7 +1,9 @@
##parameters=title, description, **kw
##
+from Products.CMFDefault.utils import MessageID as _
+
if title!=context.title or description != context.description:
context.edit(title=title, description=description)
- return context.setStatus(True, 'Folder changed.')
+ return context.setStatus(True, _('Folder changed.'))
else:
- return context.setStatus(False, 'Nothing to change.')
+ return context.setStatus(False, _('Nothing to change.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_content/folder_edit_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/folder_edit_form.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_content/folder_edit_form.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,5 +1,7 @@
##parameters=change='', change_and_view=''
##
+from Products.CMFDefault.utils import MessageID as _
+
form = context.REQUEST.form
if change and \
context.folder_edit_control(**form) and \
@@ -15,8 +17,8 @@
buttons = []
target = context.getActionInfo('object/edit')['url']
-buttons.append( {'name': 'change', 'value': 'Change'} )
-buttons.append( {'name': 'change_and_view', 'value': 'Change and View'} )
+buttons.append( {'name': 'change', 'value': _('Change')} )
+buttons.append( {'name': 'change_and_view', 'value': _('Change and View')} )
options['form'] = { 'action': target,
'listButtonInfos': tuple(buttons) }
Modified: CMF/trunk/CMFDefault/skins/zpt_content/full_metadata_edit_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/full_metadata_edit_form.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_content/full_metadata_edit_form.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,5 +1,7 @@
##parameters=change='', change_and_edit='', change_and_view=''
##
+from Products.CMFDefault.utils import MessageID as _
+
form = context.REQUEST.form
if change and \
context.metadata_edit_control(**form) and \
@@ -22,9 +24,9 @@
allow_discussion = getattr(context, 'allow_discussion', None)
if allow_discussion is not None:
allow_discussion = bool(allow_discussion)
-buttons.append( {'name': 'change', 'value': 'Change'} )
-buttons.append( {'name': 'change_and_edit', 'value': 'Change and Edit'} )
-buttons.append( {'name': 'change_and_view', 'value': 'Change and View'} )
+buttons.append( {'name': 'change', 'value': _('Change')} )
+buttons.append( {'name': 'change_and_edit', 'value': _('Change and Edit')} )
+buttons.append( {'name': 'change_and_view', 'value': _('Change and View')} )
options['form'] = { 'action': target,
'allow_discussion': allow_discussion,
'listButtonInfos': tuple(buttons) }
Modified: CMF/trunk/CMFDefault/skins/zpt_content/image_edit_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/image_edit_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_content/image_edit_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,9 +1,10 @@
##parameters=file, **kw
##
from Products.CMFDefault.exceptions import ResourceLockedError
+from Products.CMFDefault.utils import MessageID as _
try:
context.edit(file=file)
- return context.setStatus(True, 'Image changed.')
+ return context.setStatus(True, _('Image changed.'))
except ResourceLockedError, errmsg:
return context.setStatus(False, errmsg)
Modified: CMF/trunk/CMFDefault/skins/zpt_content/image_edit_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/image_edit_form.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_content/image_edit_form.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,5 +1,7 @@
##parameters=change='', change_and_view=''
##
+from Products.CMFDefault.utils import MessageID as _
+
form = context.REQUEST.form
if change and \
context.image_edit_control(**form) and \
@@ -15,8 +17,8 @@
buttons = []
target = context.getActionInfo('object/edit')['url']
-buttons.append( {'name': 'change', 'value': 'Change'} )
-buttons.append( {'name': 'change_and_view', 'value': 'Change and View'} )
+buttons.append( {'name': 'change', 'value': _('Change')} )
+buttons.append( {'name': 'change_and_view', 'value': _('Change and View')} )
options['form'] = { 'action': target,
'listButtonInfos': tuple(buttons) }
Modified: CMF/trunk/CMFDefault/skins/zpt_content/link_edit_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/link_edit_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_content/link_edit_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,12 +1,13 @@
##parameters=remote_url, **kw
##
from Products.CMFDefault.exceptions import ResourceLockedError
+from Products.CMFDefault.utils import MessageID as _
if remote_url != context.remote_url:
try:
context.edit(remote_url=remote_url)
- return context.setStatus(True, 'Link changed.')
+ return context.setStatus(True, _('Link changed.'))
except ResourceLockedError, errmsg:
return context.setStatus(False, errmsg)
else:
- return context.setStatus(False, 'Nothing to change.')
+ return context.setStatus(False, _('Nothing to change.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_content/link_edit_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/link_edit_form.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_content/link_edit_form.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,5 +1,7 @@
##parameters=change='', change_and_view=''
##
+from Products.CMFDefault.utils import MessageID as _
+
form = context.REQUEST.form
if change and \
context.link_edit_control(**form) and \
@@ -15,8 +17,8 @@
buttons = []
target = context.getActionInfo('object/edit')['url']
-buttons.append( {'name': 'change', 'value': 'Change'} )
-buttons.append( {'name': 'change_and_view', 'value': 'Change and View'} )
+buttons.append( {'name': 'change', 'value': _('Change')} )
+buttons.append( {'name': 'change_and_view', 'value': _('Change and View')} )
options['form'] = { 'action': target,
'listButtonInfos': tuple(buttons) }
Modified: CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -2,6 +2,7 @@
##
from Products.CMFCore.utils import getToolByName
from Products.CMFDefault.exceptions import ResourceLockedError
+from Products.CMFDefault.utils import MessageID as _
dtool = getToolByName(script, 'portal_discussion')
@@ -63,6 +64,6 @@
, language=language
, rights=rights
)
- return context.setStatus(True, 'Metadata changed.')
+ return context.setStatus(True, _('Metadata changed.'))
except ResourceLockedError, errmsg:
return context.setStatus(False, errmsg)
Modified: CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_form.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_form.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,5 +1,7 @@
##parameters=change='', change_and_edit='', change_and_view=''
##
+from Products.CMFDefault.utils import MessageID as _
+
form = context.REQUEST.form
if change and \
context.metadata_edit_control(**form) and \
@@ -22,9 +24,9 @@
allow_discussion = getattr(context, 'allow_discussion', None)
if allow_discussion is not None:
allow_discussion = bool(allow_discussion)
-buttons.append( {'name': 'change', 'value': 'Change'} )
-buttons.append( {'name': 'change_and_edit', 'value': 'Change and Edit'} )
-buttons.append( {'name': 'change_and_view', 'value': 'Change and View'} )
+buttons.append( {'name': 'change', 'value': _('Change')} )
+buttons.append( {'name': 'change_and_edit', 'value': _('Change and Edit')} )
+buttons.append( {'name': 'change_and_view', 'value': _('Change and View')} )
options['form'] = { 'action': target,
'allow_discussion': allow_discussion,
'listButtonInfos': tuple(buttons) }
Modified: CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,14 +1,15 @@
##parameters=text_format, text, description='', **kw
##
from Products.CMFDefault.exceptions import ResourceLockedError
+from Products.CMFDefault.utils import MessageID as _
if description != context.description or \
text_format != context.text_format or text != context.text:
try:
context.edit(text=text, description=description,
text_format=text_format)
- return context.setStatus(True, 'News Item changed.')
+ return context.setStatus(True, _('News Item changed.'))
except ResourceLockedError, errmsg:
return context.setStatus(False, errmsg)
else:
- return context.setStatus(False, 'Nothing to change.')
+ return context.setStatus(False, _('Nothing to change.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_form.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_form.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,5 +1,7 @@
##parameters=change='', change_and_view=''
##
+from Products.CMFDefault.utils import MessageID as _
+
form = context.REQUEST.form
if change and \
context.validateHTML(**form) and \
@@ -17,8 +19,8 @@
buttons = []
target = context.getActionInfo('object/edit')['url']
-buttons.append( {'name': 'change', 'value': 'Change'} )
-buttons.append( {'name': 'change_and_view', 'value': 'Change and View'} )
+buttons.append( {'name': 'change', 'value': _('Change')} )
+buttons.append( {'name': 'change_and_view', 'value': _('Change and View')} )
options['form'] = { 'action': target,
'listButtonInfos': tuple(buttons) }
Modified: CMF/trunk/CMFDefault/skins/zpt_control/folder_bottom_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_control/folder_bottom_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_control/folder_bottom_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,12 +1,15 @@
##parameters=ids, **kw
##
+from Products.CMFDefault.utils import MessageID as _
+
subset_ids = [ obj.getId() for obj in context.listFolderContents() ]
try:
attempt = context.moveObjectsToBottom(ids, subset_ids=subset_ids)
- if attempt:
- return context.setStatus( True, '%d item%s moved to bottom.' %
- ( attempt, (attempt != 1 and 's' or '') ) )
+ if attempt == 1:
+ return context.setStatus(True, _('Item moved to bottom.'))
+ elif attempt > 1:
+ return context.setStatus(True, _('Items moved to bottom.'))
else:
- return context.setStatus(False, 'Nothing to change.')
-except ValueError, errmsg:
- return context.setStatus(False, 'ValueError: %s' % errmsg)
+ return context.setStatus(False, _('Nothing to change.'))
+except ValueError:
+ return context.setStatus(False, _('ValueError: Move failed.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_control/folder_copy_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_control/folder_copy_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_control/folder_copy_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -2,10 +2,13 @@
##title=Copy objects from a folder to the clipboard
##
from Products.CMFDefault.exceptions import CopyError
+from Products.CMFDefault.utils import MessageID as _
try:
context.manage_copyObjects(ids, context.REQUEST)
- return context.setStatus( True, 'Item%s copied.' %
- ( len(ids) != 1 and 's' or '' ) )
+ if len(ids) == 1:
+ return context.setStatus(True, _('Item copied.'))
+ else:
+ return context.setStatus(True, _('Items copied.'))
except CopyError:
- return context.setStatus(False, 'CopyError: Copy failed.')
+ return context.setStatus(False, _('CopyError: Copy failed.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_control/folder_cut_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_control/folder_cut_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_control/folder_cut_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -2,10 +2,13 @@
##title=Cut objects from a folder and copy to the clipboard
##
from Products.CMFDefault.exceptions import CopyError
+from Products.CMFDefault.utils import MessageID as _
try:
context.manage_cutObjects(ids, context.REQUEST)
- return context.setStatus( True, 'Item%s cut.' %
- ( len(ids) != 1 and 's' or '' ) )
+ if len(ids) == 1:
+ return context.setStatus(True, _('Item cut.'))
+ else:
+ return context.setStatus(True, _('Items cut.'))
except CopyError:
- return context.setStatus(False, 'CopyError: Cut failed.')
+ return context.setStatus(False, _('CopyError: Cut failed.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_control/folder_delete_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_control/folder_delete_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_control/folder_delete_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,7 +1,11 @@
##parameters=ids, **kw
##title=Delete objects from a folder
##
+from Products.CMFDefault.utils import MessageID as _
+
context.manage_delObjects( list(ids) )
-return context.setStatus( True, 'Item%s deleted.' %
- ( len(ids) != 1 and 's' or '' ) )
+if len(ids) == 1:
+ return context.setStatus(True, _('Item deleted.'))
+else:
+ return context.setStatus(True, _('Items deleted.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_control/folder_down_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_control/folder_down_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_control/folder_down_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,12 +1,15 @@
##parameters=ids, delta, **kw
##
+from Products.CMFDefault.utils import MessageID as _
+
subset_ids = [ obj.getId() for obj in context.listFolderContents() ]
try:
attempt = context.moveObjectsDown(ids, delta, subset_ids=subset_ids)
- if attempt:
- return context.setStatus( True, '%d item%s moved down.' %
- ( attempt, (attempt != 1 and 's' or '') ) )
+ if attempt == 1:
+ return context.setStatus(True, _('Item moved down.'))
+ elif attempt > 1:
+ return context.setStatus(True, _('Items moved down.'))
else:
- return context.setStatus(False, 'Nothing to change.')
-except ValueError, errmsg:
- return context.setStatus(False, 'ValueError: %s' % errmsg)
+ return context.setStatus(False, _('Nothing to change.'))
+except ValueError:
+ return context.setStatus(False, _('ValueError: Move failed.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_control/folder_paste_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_control/folder_paste_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_control/folder_paste_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -3,16 +3,19 @@
##
from Products.CMFDefault.exceptions import CopyError
from Products.CMFDefault.exceptions import zExceptions_Unauthorized
+from Products.CMFDefault.utils import MessageID as _
if context.cb_dataValid:
try:
result = context.manage_pasteObjects(context.REQUEST['__cp'])
- return context.setStatus( True, 'Item%s pasted.' %
- ( len(result) != 1 and 's' or '' ) )
+ if len(ids) == 1:
+ return context.setStatus(True, _('Item pasted.'))
+ else:
+ return context.setStatus(True, _('Items pasted.'))
except CopyError:
- return context.setStatus(False, 'CopyError: Paste failed.')
+ return context.setStatus(False, _('CopyError: Paste failed.'))
except zExceptions_Unauthorized:
- return context.setStatus(False, 'Unauthorized: Paste failed.')
+ return context.setStatus(False, _('Unauthorized: Paste failed.'))
else:
- return context.setStatus(False, 'Please copy or cut one or more items to'
- 'paste first.')
+ return context.setStatus(False, _('Please copy or cut one or more items '
+ 'to paste first.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_control/folder_rename_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_control/folder_rename_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_control/folder_rename_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -2,13 +2,16 @@
##title=Rename objects in a folder
##
from Products.CMFDefault.exceptions import CopyError
+from Products.CMFDefault.utils import MessageID as _
if not ids == new_ids:
try:
context.manage_renameObjects(ids, new_ids)
- return context.setStatus(True, 'Item%s renamed.' %
- ( len(ids) != 1 and 's' or '' ) )
+ if len(ids) == 1:
+ return context.setStatus(True, _('Item renamed.'))
+ else:
+ return context.setStatus(True, _('Items renamed.'))
except CopyError:
- return context.setStatus(False, 'CopyError: Rename failed.')
+ return context.setStatus(False, _('CopyError: Rename failed.'))
else:
- return context.setStatus(False, 'Nothing to change.')
+ return context.setStatus(False, _('Nothing to change.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_control/folder_top_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_control/folder_top_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_control/folder_top_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,12 +1,15 @@
##parameters=ids, **kw
##
+from Products.CMFDefault.utils import MessageID as _
+
subset_ids = [ obj.getId() for obj in context.listFolderContents() ]
try:
attempt = context.moveObjectsToTop(ids, subset_ids=subset_ids)
- if attempt:
- return context.setStatus( True, '%d item%s moved to top.' %
- ( attempt, (attempt != 1 and 's' or '') ) )
+ if attempt == 1:
+ return context.setStatus(True, _('Item moved to top.'))
+ elif attempt > 1:
+ return context.setStatus(True, _('Items moved to top.'))
else:
- return context.setStatus(False, 'Nothing to change.')
-except ValueError, errmsg:
- return context.setStatus(False, 'ValueError: %s' % errmsg)
+ return context.setStatus(False, _('Nothing to change.'))
+except ValueError:
+ return context.setStatus(False, _('ValueError: Move failed.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_control/folder_up_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_control/folder_up_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_control/folder_up_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,12 +1,15 @@
##parameters=ids, delta, **kw
##
+from Products.CMFDefault.utils import MessageID as _
+
subset_ids = [ obj.getId() for obj in context.listFolderContents() ]
try:
attempt = context.moveObjectsUp(ids, delta, subset_ids=subset_ids)
- if attempt:
- return context.setStatus( True, '%d item%s moved up.' %
- ( attempt, (attempt != 1 and 's' or '') ) )
+ if attempt == 1:
+ return context.setStatus(True, _('Item moved up.'))
+ elif attempt > 1:
+ return context.setStatus(True, _('Items moved up.'))
else:
- return context.setStatus(False, 'Nothing to change.')
-except ValueError, errmsg:
- return context.setStatus(False, 'ValueError: %s' % errmsg)
+ return context.setStatus(False, _('Nothing to change.'))
+except ValueError:
+ return context.setStatus(False, _('ValueError: Move failed.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_control/members_add_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_control/members_add_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_control/members_add_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -3,6 +3,7 @@
##
from Products.CMFCore.utils import getToolByName
from Products.CMFDefault.permissions import ManageUsers
+from Products.CMFDefault.utils import MessageID as _
mtool = getToolByName(script, 'portal_membership')
ptool = getToolByName(script, 'portal_properties')
@@ -18,6 +19,6 @@
if ptool.getProperty('validate_email') or send_password:
rtool.registeredNotify(member_id)
if mtool.checkPermission(ManageUsers, mtool):
- return context.setStatus(True, 'Member registered.')
+ return context.setStatus(True, _('Member registered.'))
else:
- return context.setStatus(False, 'Success!')
+ return context.setStatus(False, _('Success!'))
Modified: CMF/trunk/CMFDefault/skins/zpt_control/members_delete_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_control/members_delete_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_control/members_delete_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -2,10 +2,13 @@
##title=Delete members
##
from Products.CMFCore.utils import getToolByName
+from Products.CMFDefault.utils import MessageID as _
mtool = getToolByName(script, 'portal_membership')
mtool.deleteMembers(ids)
-return context.setStatus( True, 'Selected member%s deleted.' %
- ( len(ids) != 1 and 's' or '' ) )
+if len(ids) == 1:
+ return context.setStatus(True, _('Selected member deleted.'))
+else:
+ return context.setStatus(True, _('Selected members deleted.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_control/portal_config_control.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_control/portal_config_control.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_control/portal_config_control.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,6 +1,7 @@
##parameters=**kw
##
from Products.CMFCore.utils import getToolByName
+from Products.CMFDefault.utils import MessageID as _
ptool = getToolByName(script, 'portal_properties')
@@ -8,4 +9,4 @@
ptool.manage_addProperty('default_charset', '', 'string')
ptool.editProperties(kw)
-return context.setStatus(True, 'CMF Settings changed.')
+return context.setStatus(True, _('CMF Settings changed.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_control/validateId.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_control/validateId.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_control/validateId.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,10 +1,11 @@
##parameters=id='', **kw
-##title=
##
+from Products.CMFDefault.utils import MessageID as _
+
if id:
if context.checkIdAvailable(id):
return context.setStatus(True)
else:
- return context.setStatus(False, 'Please choose another ID.')
+ return context.setStatus(False, _('Please choose another ID.'))
else:
- return context.setStatus(False, 'Please enter an ID.')
+ return context.setStatus(False, _('Please enter an ID.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_control/validateItemIds.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_control/validateItemIds.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_control/validateItemIds.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,8 +1,9 @@
-## Script (Python) "validateItemIds"
##parameters=ids=(), **kw
-##title=
##
+from Products.CMFDefault.utils import MessageID as _
+
if ids:
return context.setStatus(True)
else:
- return context.setStatus(False, 'Please select one or more items first.')
+ return context.setStatus(False, _('Please select one or more items '
+ 'first.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_control/validateMemberIds.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_control/validateMemberIds.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_control/validateMemberIds.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,8 +1,9 @@
-## Script (Python) "validateMemberIds"
##parameters=ids=(), **kw
-##title=
##
+from Products.CMFDefault.utils import MessageID as _
+
if ids:
return context.setStatus(True)
else:
- return context.setStatus(False, 'Please select one or more members first.')
+ return context.setStatus(False, _('Please select one or more members '
+ 'first.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_control/validateType.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_control/validateType.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_control/validateType.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,7 +1,8 @@
##parameters=type_name='', **kw
-##title=
##
+from Products.CMFDefault.utils import MessageID as _
+
if type_name:
return context.setStatus(True)
else:
- return context.setStatus(False, 'Please select a content type.')
+ return context.setStatus(False, _('Please select a content type.'))
Modified: CMF/trunk/CMFDefault/skins/zpt_generic/breadcrumbs.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_generic/breadcrumbs.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_generic/breadcrumbs.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -2,13 +2,15 @@
##title=Return breadcrumbs
##
from Products.CMFCore.utils import getToolByName
+from Products.CMFDefault.utils import MessageID as _
+
ptool = getToolByName(script, 'portal_properties')
utool = getToolByName(script, 'portal_url')
portal_url = utool()
result = []
if include_root:
- result.append( { 'id' : 'root'
+ result.append( { 'id' : _('root')
, 'title' : ptool.title()
, 'url' : portal_url
}
Modified: CMF/trunk/CMFDefault/skins/zpt_generic/folder_contents.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_generic/folder_contents.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_generic/folder_contents.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -9,6 +9,7 @@
from Products.CMFDefault.permissions import ManageProperties
from Products.CMFDefault.permissions import ViewManagementScreens
from Products.CMFDefault.utils import html_marshal
+from Products.CMFDefault.utils import MessageID as _
mtool = getToolByName(script, 'portal_membership')
utool = getToolByName(script, 'portal_url')
@@ -105,19 +106,19 @@
is_default = 0
columns = ( {'key': 'Type',
- 'title': 'Type',
+ 'title': _('Type'),
'width': '20',
'colspan': '2'}
, {'key': 'getId',
- 'title': 'Name',
+ 'title': _('Name'),
'width': '360',
'colspan': None}
, {'key': 'modified',
- 'title': 'Last Modified',
+ 'title': _('Last Modified'),
'width': '180',
'colspan': None}
, {'key': 'position',
- 'title': 'Position',
+ 'title': _('Position'),
'width': '80',
'colspan': None }
)
@@ -164,16 +165,16 @@
buttons = []
if items_manage_allowed:
if items_add_allowed and context.allowedContentTypes():
- buttons.append( {'name': 'items_new', 'value': 'New...'} )
+ buttons.append( {'name': 'items_new', 'value': _('New...')} )
if items:
- buttons.append( {'name': 'items_rename', 'value': 'Rename'} )
+ buttons.append( {'name': 'items_rename', 'value': _('Rename')} )
if items:
- buttons.append( {'name': 'items_cut', 'value': 'Cut'} )
- buttons.append( {'name': 'items_copy', 'value': 'Copy'} )
+ buttons.append( {'name': 'items_cut', 'value': _('Cut')} )
+ buttons.append( {'name': 'items_copy', 'value': _('Copy')} )
if items_add_allowed and context.cb_dataValid():
- buttons.append( {'name': 'items_paste', 'value': 'Paste'} )
+ buttons.append( {'name': 'items_paste', 'value': _('Paste')} )
if items_delete_allowed and items:
- buttons.append( {'name': 'items_delete', 'value': 'Delete'} )
+ buttons.append( {'name': 'items_delete', 'value': _('Delete')} )
length = batch_obj.sequence_length
is_orderable = items_move_allowed and (key == 'position') and length > 1
is_sortable = items_move_allowed and not is_default
Modified: CMF/trunk/CMFDefault/skins/zpt_generic/folder_rename_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_generic/folder_rename_form.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_generic/folder_rename_form.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -2,6 +2,7 @@
##
from Products.CMFCore.utils import getToolByName
from Products.CMFDefault.utils import html_marshal
+from Products.CMFDefault.utils import MessageID as _
utool = getToolByName(script, 'portal_url')
portal_url = utool()
@@ -38,8 +39,8 @@
for name, value in html_marshal(**default_kw):
hidden_vars.append( {'name': name, 'value': value} )
buttons = []
-buttons.append( {'name': 'rename', 'value': 'Rename'} )
-buttons.append( {'name': 'cancel', 'value': 'Cancel'} )
+buttons.append( {'name': 'rename', 'value': _('Rename')} )
+buttons.append( {'name': 'cancel', 'value': _('Cancel')} )
options['form'] = { 'action': target,
'listHiddenVarInfos': tuple(hidden_vars),
'listButtonInfos': tuple(buttons) }
Modified: CMF/trunk/CMFDefault/skins/zpt_generic/join_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_generic/join_form.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_generic/join_form.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -2,6 +2,7 @@
##
from Products.CMFCore.utils import getToolByName
from Products.CMFDefault.permissions import ManageUsers
+from Products.CMFDefault.utils import MessageID as _
atool = getToolByName(script, 'portal_actions')
mtool = getToolByName(script, 'portal_membership')
@@ -27,11 +28,12 @@
options = {}
-if context.REQUEST.get('portal_status_message', '') == 'Success!':
+if context.REQUEST.get('portal_status_message', '') == _('Success!'):
is_anon = False
is_newmember = True
-options['title'] = is_usermanager and 'Register Member' or 'Become a Member'
+options['title'] = is_usermanager and _('Register Member') \
+ or _('Become a Member')
options['member_id'] = member_id
options['member_email'] = member_email
options['password'] = is_newmember and context.REQUEST.get('password', '') or ''
@@ -46,11 +48,11 @@
buttons = []
if is_newmember:
target = atool.getActionInfo('user/logged_in')['url']
- buttons.append( {'name': 'login', 'value': 'Log in'} )
+ buttons.append( {'name': 'login', 'value': _('Log in')} )
else:
target = atool.getActionInfo('user/join')['url']
- buttons.append( {'name': 'add', 'value': 'Register'} )
- buttons.append( {'name': 'cancel', 'value': 'Cancel'} )
+ buttons.append( {'name': 'add', 'value': _('Register')} )
+ buttons.append( {'name': 'cancel', 'value': _('Cancel')} )
options['form'] = { 'action': target,
'listButtonInfos': tuple(buttons) }
Modified: CMF/trunk/CMFDefault/skins/zpt_generic/members_delete_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_generic/members_delete_form.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_generic/members_delete_form.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -2,6 +2,7 @@
##
from Products.CMFCore.utils import getToolByName
from Products.CMFDefault.utils import html_marshal
+from Products.CMFDefault.utils import MessageID as _
atool = getToolByName(script, 'portal_actions')
@@ -23,8 +24,8 @@
for name, value in html_marshal(b_start=b_start, ids=ids):
hidden_vars.append( {'name': name, 'value': value} )
buttons = []
-buttons.append( {'name': 'delete', 'value': 'Delete'} )
-buttons.append( {'name': 'cancel', 'value': 'Cancel'} )
+buttons.append( {'name': 'delete', 'value': _('Delete')} )
+buttons.append( {'name': 'cancel', 'value': _('Cancel')} )
options['form'] = { 'action': target,
'members': ', '.join(ids),
'listHiddenVarInfos': tuple(hidden_vars),
Modified: CMF/trunk/CMFDefault/skins/zpt_generic/members_manage_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_generic/members_manage_form.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_generic/members_manage_form.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -3,6 +3,7 @@
from ZTUtils import Batch
from Products.CMFCore.utils import getToolByName
from Products.CMFDefault.utils import html_marshal
+from Products.CMFDefault.utils import MessageID as _
atool = getToolByName(script, 'portal_actions')
mtool = getToolByName(script, 'portal_membership')
@@ -45,9 +46,9 @@
for name, value in html_marshal(b_start=b_start):
hidden_vars.append( {'name': name, 'value': value} )
buttons = []
-buttons.append( {'name': 'members_new', 'value': 'New...'} )
+buttons.append( {'name': 'members_new', 'value': _('New...')} )
if items:
- buttons.append( {'name': 'members_delete', 'value': 'Delete...'} )
+ buttons.append( {'name': 'members_delete', 'value': _('Delete...')} )
options['form'] = { 'action': target,
'listHiddenVarInfos': tuple(hidden_vars),
'listButtonInfos': tuple(buttons) }
Modified: CMF/trunk/CMFDefault/skins/zpt_generic/reconfig_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_generic/reconfig_form.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/skins/zpt_generic/reconfig_form.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -1,6 +1,7 @@
##parameters=change=''
##
from Products.CMFCore.utils import getToolByName
+from Products.CMFDefault.utils import MessageID as _
atool = getToolByName(script, 'portal_actions')
ptool = getToolByName(script, 'portal_properties')
@@ -17,7 +18,7 @@
target = atool.getActionInfo('global/configPortal')['url']
buttons = []
-buttons.append( {'name': 'change', 'value': 'Change'} )
+buttons.append( {'name': 'change', 'value': _('Change')} )
options['form'] = { 'action': target,
'email_from_name': ptool.getProperty('email_from_name'),
'email_from_address':
Modified: CMF/trunk/CMFDefault/utils.py
===================================================================
--- CMF/trunk/CMFDefault/utils.py 2005-08-11 16:02:38 UTC (rev 37868)
+++ CMF/trunk/CMFDefault/utils.py 2005-08-11 16:34:28 UTC (rev 37869)
@@ -24,6 +24,7 @@
from AccessControl import ModuleSecurityInfo
from Globals import package_home
+from zope.i18nmessageid import MessageIDFactory
from ZTUtils.Zope import complex_marshal
from exceptions import IllegalHTML
@@ -426,3 +427,6 @@
return value
else:
return value
+
+security.declarePublic('MessageID')
+MessageID = MessageIDFactory('cmf_default')
More information about the CMF-checkins
mailing list