3344d573a942bea512dffdf5f1d3151e19123c92
1 # -*- coding: utf-8 -*-
2 ############################################################
3 # Copyright © 2008 Benoît PIN <benoit.pin@ensmp.fr> #
4 # Plinn - http://plinn.org #
6 # This program is free software; you can redistribute it #
7 # and/or modify it under the terms of the Creative Commons #
8 # "Attribution-Noncommercial 2.0 Generic" #
9 # http://creativecommons.org/licenses/by-nc/2.0/ #
10 ############################################################
14 $Id: utils.py 651 2009-02-04 15:38:20Z pin $
15 $URL: http://svn.luxia.fr/svn/labo/projects/zope/photoprint/trunk/utils.py $
18 from AccessControl
import ModuleSecurityInfo
19 # TODO: trouver une solution…
20 #from Products.PageTemplates.GlobalTranslationService import getGlobalTranslationService
21 from zope
.i18nmessageid
import MessageFactory
23 security
= ModuleSecurityInfo('Products.photoprint.utils')
25 security
.declarePublic('translate')
26 def translate(message
, context
):
27 """ Translate i18n message.
29 # GTS = getGlobalTranslationService()
30 if isinstance(message
, Exception):
33 except (TypeError, IndexError):
36 return GTS
.translate('photoprint', message
, context
=context
)
38 security
.declarePublic('Message')
39 Message
= _
= MessageFactory('photoprint')