from random import randrange
from Acquisition import aq_base
from quopri import encodestring
from random import randrange
from Acquisition import aq_base
from quopri import encodestring
from AccessControl.PermissionRole import rolesForPermissionOn
from AccessControl import ModuleSecurityInfo
from AccessControl import getSecurityManager
from AccessControl.PermissionRole import rolesForPermissionOn
from AccessControl import ModuleSecurityInfo
from AccessControl import getSecurityManager
""" Translate i18n message.
"""
if isinstance(message, Exception):
""" Translate i18n message.
"""
if isinstance(message, Exception):
- return i18ntranslate(message, domain='plinn', context=context.REQUEST)
+ if not context :
+ request = getRequest()
+ else :
+ request = context.REQUEST
+ return i18ntranslate(message, domain='plinn', context=request)