On Zope 2.12, the new Localizer MessageCatalog.translate() doesn't accept...

On Zope 2.12, the new Localizer MessageCatalog.translate() doesn't accept 'domain' as keyword parameter as it IS the domain (approved by jm)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30235 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4b1f5b14
......@@ -65,7 +65,11 @@ except ImportError:
# FIXME: Remove this check once we're using getUtility
if ITranslationDomain.providedBy(translation_domain):
return translation_domain.translate
return zope.i18n.translate
# Localizer above does not like the 'domain' keyword, but zope.i18n
# needs it.
def translate(**kw):
return zope.i18n.translate(domain=domain, **kw)
return translate
def translate(self, domain, msgid, context=None, **kw):
translate = self.getTranslateMethod(context, domain)
......@@ -76,7 +80,7 @@ except ImportError:
# MessageCatalog abides by the zope.i18n.interface definitions.
# (Actually, it ignores the context).
request = aq_get(context, 'REQUEST', None)
return translate(msgid=msgid, domain=domain, context=request, **kw)
return translate(msgid=msgid, context=request, **kw)
getGlobalTranslationService = GlobalTranslationService
......
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