projects
/
Plinn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
af9b4da
)
Résolu : problème de localisation avec zope-2.12.
author
Benoît Pin
<benoit.pin@gmail.com>
Tue, 26 Oct 2010 14:18:27 +0000
(16:18 +0200)
committer
Benoît Pin
<benoit.pin@gmail.com>
Tue, 26 Oct 2010 14:18:27 +0000
(16:18 +0200)
utils.py
patch
|
blob
|
history
diff --git
a/utils.py
b/utils.py
index
726c4e8
..
14097e4
100755
(executable)
--- a/
utils.py
+++ b/
utils.py
@@
-36,7
+36,7
@@
from Products.CMFCore.utils import getToolByName, getUtilityByInterfaceName
from Products.CMFCore.exceptions import BadRequest
from Products.Utf8Splitter.Utf8Splitter import Utf8Utils
from Globals import REPLACEABLE, NOT_REPLACEABLE, UNIQUE
from Products.CMFCore.exceptions import BadRequest
from Products.Utf8Splitter.Utf8Splitter import Utf8Utils
from Globals import REPLACEABLE, NOT_REPLACEABLE, UNIQUE
-
#from Products.PageTemplates.GlobalTranslationService import getGlobalTranslationServic
e
+
from zope.i18n import translate as i18ntranslat
e
from zope.i18n.interfaces import IUserPreferredLanguages
from zope.i18nmessageid import MessageFactory
from zope.component.interfaces import ComponentLookupError
from zope.i18n.interfaces import IUserPreferredLanguages
from zope.i18nmessageid import MessageFactory
from zope.component.interfaces import ComponentLookupError
@@
-195,15
+195,12
@@
security.declarePublic('translate')
def translate(message, context):
""" Translate i18n message.
"""
def translate(message, context):
""" Translate i18n message.
"""
- # TODO : localisation.
- #GTS = getGlobalTranslationService()
if isinstance(message, Exception):
try:
message = message[0]
except (TypeError, IndexError):
pass
if isinstance(message, Exception):
try:
message = message[0]
except (TypeError, IndexError):
pass
- return message
- return GTS.translate('plinn', message, context=context)
+ return i18ntranslate(message, domain='plinn', context=context.REQUEST)
security.declarePublic('desacc')
desacc = Utf8Utils.desacc
security.declarePublic('desacc')
desacc = Utf8Utils.desacc