Commit 49f61d11 authored by Bartek Górny's avatar Bartek Górny

if Localizer can not be acquired return untranslated message

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11782 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 04ee751a
...@@ -83,8 +83,12 @@ def GlobalTranslationService_translate(self, domain, msgid, *args, **kw): ...@@ -83,8 +83,12 @@ def GlobalTranslationService_translate(self, domain, msgid, *args, **kw):
if context is None: if context is None:
# Placeless! # Placeless!
return msgid return msgid
# XXX patch -because if context is ZMailIn, it is at the site root
# and does not find Localizer by acquisition
try:
return context.Localizer.translate(domain, msgid, *args, **kw) return context.Localizer.translate(domain, msgid, *args, **kw)
except AttributeError:
return msgid
# Apply the monkey patch. # Apply the monkey patch.
from Products.Localizer.Localizer import Localizer from Products.Localizer.Localizer import Localizer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment