diff --git a/bin/new.py b/bin/new.py index 6453d7b..be03279 100644 --- a/bin/new.py +++ b/bin/new.py @@ -191,7 +191,7 @@ class NewScript: def patchPlone3x(self): '''Auto-proclaimed ugly code in z3c forces us to patch some files in Products.CMFPlone because these guys make the assumption that - "plone.xxx" packages are within eggs when they've implemented their + "plone.*" packages are within eggs when they've implemented their ZCML directives "includePlugins" and "includePluginsOverrides". So in this method, I remove every call to those directives in CMFPlone files. It does not seem to affect Plone behaviour. Indeed, diff --git a/gen/__init__.py b/gen/__init__.py index 1f5a05a..71d9ca9 100644 --- a/gen/__init__.py +++ b/gen/__init__.py @@ -2728,7 +2728,7 @@ class Transition: sendNotification(obj.appy(), self, transitionName, wf) # Return a message to the user if needed if not doSay or (transitionName == '_init_'): return - if not msg: msg = 'Changes saved.' # XXX Translate + if not msg: msg = obj.translate('object_saved') obj.say(msg) class Permission: diff --git a/gen/generator.py b/gen/generator.py index 8a92fc4..f93ac6b 100644 --- a/gen/generator.py +++ b/gen/generator.py @@ -445,6 +445,8 @@ class ZopeGenerator(Generator): msg('bad_select_value', '', msg.BAD_SELECT_VALUE), msg('select_delesect', '', msg.SELECT_DESELECT), msg('no_elem_selected', '', msg.NO_SELECTION), + msg('object_edit', '', msg.EDIT), + msg('object_delete', '', msg.DELETE), msg('delete_confirm', '', msg.DELETE_CONFIRM), msg('delete_done', '', msg.DELETE_DONE), msg('goto_first', '', msg.GOTO_FIRST), @@ -466,6 +468,25 @@ class ZopeGenerator(Generator): msg('front_page_text', '', msg.FRONT_PAGE_TEXT), msg('captcha_text', '', msg.CAPTCHA_TEXT), msg('bad_captcha', '', msg.BAD_CAPTCHA), + msg('app_login', '', msg.LOGIN), + msg('app_connect', '', msg.CONNECT), + msg('app_logout', '', msg.LOGOUT), + msg('app_password', '', msg.PASSWORD), + msg('app_home', '', msg.HOME), + msg('login_reserved', '', msg.LOGIN_RESERVED), + msg('login_in_use', '', msg.LOGIN_IN_USE), + msg('login_ko', '', msg.LOGIN_KO), + msg('login_ok', '', msg.LOGIN_OK), + msg('password_too_short', '', msg.PASSWORD_TOO_SHORT), + msg('passwords_mismatch', '', msg.PASSWORDS_MISMATCH), + msg('object_save', '', msg.SAVE), + msg('object_saved', '', msg.SAVED), + msg('validation_error', '', msg.ERROR), + msg('object_cancel', '', msg.CANCEL), + msg('object_canceled', '', msg.CANCELED), + msg('enable_cookies', '', msg.ENABLE_COOKIES), + msg('page_previous', '', msg.PAGE_PREVIOUS), + msg('page_next', '', msg.PAGE_NEXT), ] # Create a label for every role added by this application for role in self.getAllUsedRoles(): diff --git a/gen/mixins/ToolMixin.py b/gen/mixins/ToolMixin.py index 7f3cee6..5526439 100644 --- a/gen/mixins/ToolMixin.py +++ b/gen/mixins/ToolMixin.py @@ -876,7 +876,7 @@ class ToolMixin(BaseMixin): urlBack = rq['HTTP_REFERER'] if jsEnabled and not cookiesEnabled: - msg = 'You must enable cookies before you can log in.' # XXX transl. + msg = self.translate('enable_cookies') return self.goto(urlBack, msg) # Perform the Zope-level authentication login = rq.get('__ac_name', '') @@ -884,11 +884,11 @@ class ToolMixin(BaseMixin): user = self.acl_users.validate(rq) if self.userIsAnon(): rq.RESPONSE.expireCookie('__ac', path='/') - msg = 'Login failed.' # XXX to translate + msg = self.translate('login_ko') logMsg = 'Authentication failed (tried with login "%s").' % login else: - msg = 'Welcome! You are now logged in.' # XXX to translate - logMsg = 'User "%s" has been logged in.' % login + msg = self.translate('login_ok') + logMsg = 'User "%s" logged in.' % login self.log(logMsg) return self.goto(self.getApp().absolute_url(), msg) diff --git a/gen/mixins/__init__.py b/gen/mixins/__init__.py index a271685..e20ccd5 100644 --- a/gen/mixins/__init__.py +++ b/gen/mixins/__init__.py @@ -202,7 +202,7 @@ class BaseMixin: fields in the database.''' rq = self.REQUEST tool = self.getTool() - errorMessage = 'Please correct the indicated errors.' # XXX Translate + errorMessage = self.translate('validation_error') isNew = rq.get('is_new') == 'True' # If this object is created from an initiator, get info about him. initiator, initiatorPage, initiatorField = self.getInitiatorInfo() @@ -217,7 +217,7 @@ class BaseMixin: urlBack = tool.getSiteUrl() else: urlBack = self.getUrl() - self.say('Changes canceled.') # XXX Translate + self.say(self.translate('object_canceled')) return self.goto(urlBack) # Object for storing validation errors @@ -253,12 +253,11 @@ class BaseMixin: obj, msg = self.createOrUpdate(isNew, values, initiator, initiatorField) # Redirect the user to the appropriate page - if not msg: msg = 'Changes saved.' # XXX Translate + if not msg: msg = self.translate('object_saved') # If the object has already been deleted (ie, it is a kind of transient # object like a one-shot form and has already been deleted in method # onEdit), redirect to the main site page. if not getattr(obj.getParentNode().aq_base, obj.id, None): - obj.unindex() return self.goto(tool.getSiteUrl(), msg) # If the user can't access the object anymore, redirect him to the # main site page. diff --git a/gen/po.py b/gen/po.py index b003c99..b7906da 100644 --- a/gen/po.py +++ b/gen/po.py @@ -92,6 +92,8 @@ class PoMessage: EMAIL_BODY = 'You can consult this element at ${objectUrl}.' SELECT_DESELECT = '(Un)select all' NO_SELECTION = 'You must select at least one element.' + EDIT = 'Edit' + DELETE = 'Delete' DELETE_CONFIRM = 'Are you sure you want to delete this element?' DELETE_DONE = 'The element has been deleted.' GOTO_FIRST = 'Go to top' @@ -115,6 +117,25 @@ class PoMessage: 'field besides, but without the character at position ' \ '${number}.' BAD_CAPTCHA = 'The code was not correct. Please try again.' + LOGIN = 'Login' + CONNECT = 'Log in' + PASSWORD = 'Password' + LOGOUT = 'Logout' + HOME = 'Home' + LOGIN_RESERVED = 'This login is reserved.' + LOGIN_IN_USE = 'This login is already in use.' + LOGIN_OK = 'Welcome! You are now logged in.' + LOGIN_KO = 'Login failed.' + PASSWORD_TOO_SHORT = 'Passwords must contain at least ${nb} characters.' + PASSWORDS_MISMATCH = 'Passwords do not match.' + SAVE = 'Save' + SAVED = 'Changes saved.' + ERROR = 'Please correct the indicated errors.' + CANCEL = 'Cancel' + CANCELED = 'Changes canceled.' + ENABLE_COOKIES = 'You must enable cookies before you can log in.' + PAGE_PREVIOUS = 'Previous page' + PAGE_NEXT = 'Next page' def __init__(self, id, msg, default, fuzzy=False, comments=[], niceDefault=False): diff --git a/gen/ui/import.pt b/gen/ui/import.pt index 6f34d2c..911eeda 100644 --- a/gen/ui/import.pt +++ b/gen/ui/import.pt @@ -60,20 +60,20 @@ -
- | + | - + value python: _('query_import')"/> + | - | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+ tal:attributes="value python: _('import_many')"/>