Commit e8181fa1 authored by Romain Courteaud's avatar Romain Courteaud

Do not raise error when translation_service.translate returns None.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6434 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent aa736df0
......@@ -100,12 +100,16 @@ class Message(Persistent):
self.message = self.message.decode('utf8')
return self.message
else:
return translation_service.translate(self.domain,
self.message,
mapping=self.mapping,
context=context,
default=self.default
).encode('utf8')
translated_message = translation_service.translate(
self.domain,
self.message,
mapping=self.mapping,
context=context,
default=self.default)
if translated_message is not None:
return translated_message.encode('utf8')
else:
return self.message
InitializeClass(Message)
allow_class(Message)
......
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