Updated exceptions messages translations
authorThierry Florac <thierry.florac@onf.fr>
Mon, 11 Sep 2017 12:25:41 +0200
changeset 106 54e93dca854d
parent 105 89d176947c0f
child 107 ace92f2db5b6
Updated exceptions messages translations
src/pyams_utils/interfaces/__init__.py
--- a/src/pyams_utils/interfaces/__init__.py	Thu Jul 13 11:44:17 2017 +0200
+++ b/src/pyams_utils/interfaces/__init__.py	Mon Sep 11 12:25:41 2017 +0200
@@ -16,10 +16,40 @@
 # import standard library
 
 # import interfaces
+from zope.schema.interfaces import WrongContainedType, NotUnique, SchemaNotFullyImplemented, SchemaNotProvided, \
+    InvalidURI, InvalidId, InvalidDottedName, Unbound, RequiredMissing, WrongType, TooBig, TooSmall, TooLong, \
+    TooShort, InvalidValue, ConstraintNotSatisfied, NotAContainer, NotAnIterator
 
 # import packages
 from zope.interface import Interface
 
+from pyams_utils import _
+
+
+#
+# Custom zope.schema exceptions messages
+#
+
+WrongContainedType.__doc__ = _("""Wrong contained type""")
+NotUnique.__doc__ = _("""One or more entries of sequence are not unique.""")
+SchemaNotFullyImplemented.__doc__ = _("""Schema not fully implemented""")
+SchemaNotProvided.__doc__ = _("""Schema not provided""")
+InvalidURI.__doc__ = _("""The specified URI is not valid.""")
+InvalidId.__doc__ = _("""The specified id is not valid.""")
+InvalidDottedName.__doc__ = _("""The specified dotted name is not valid.""")
+Unbound.__doc__ = _("""The field is not bound.""")
+
+RequiredMissing.__doc__ = _("""Required input is missing.""")
+WrongType.__doc__ = _("""Object is of wrong type.""")
+TooBig.__doc__ = _("""Value is too big""")
+TooSmall.__doc__ = _("""Value is too small""")
+TooLong.__doc__ = _("""Value is too long""")
+TooShort.__doc__ = _("""Value is too short""")
+InvalidValue.__doc__ = _("""Invalid value""")
+ConstraintNotSatisfied.__doc__ = _("""Constraint not satisfied""")
+NotAContainer.__doc__ = _("""Not a container""")
+NotAnIterator.__doc__ = _("""Not an iterator""")
+
 
 #
 # Custom permissions
@@ -37,19 +67,19 @@
 MANAGE_PERMISSION = 'manage'
 '''Permission used to manage basic information; this permission is generally not used by custom contents'''
 
-VIEW_SYSTEM_PERMISSION = 'system.view'
+VIEW_SYSTEM_PERMISSION = 'pyams.ViewSystem'
 '''Permission used to access management screens'''
 
-MANAGE_SYSTEM_PERMISSION = 'system.manage'
+MANAGE_SYSTEM_PERMISSION = 'pyams.ManageSystem'
 '''Permission used to manage system settings'''
 
-MANAGE_SKIN_PERMISSION = 'skin.manage'
+MANAGE_SKIN_PERMISSION = 'pyams.ManageSkin'
 '''Permission used to manage skin'''
 
-MANAGE_SECURITY_PERMISSION = 'security.manage'
+MANAGE_SECURITY_PERMISSION = 'pyams.ManageSecurity'
 '''Permission used to manage security settings'''
 
-MANAGE_ROLES_PERMISSION = 'security.manage_roles'
+MANAGE_ROLES_PERMISSION = 'pyams.ManageRoles'
 '''Permission used to manage roles'''