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): ...@@ -100,12 +100,16 @@ class Message(Persistent):
self.message = self.message.decode('utf8') self.message = self.message.decode('utf8')
return self.message return self.message
else: else:
return translation_service.translate(self.domain, translated_message = translation_service.translate(
self.domain,
self.message, self.message,
mapping=self.mapping, mapping=self.mapping,
context=context, context=context,
default=self.default default=self.default)
).encode('utf8') if translated_message is not None:
return translated_message.encode('utf8')
else:
return self.message
InitializeClass(Message) InitializeClass(Message)
allow_class(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