Commit e5c193fe authored by Jérome Perrin's avatar Jérome Perrin

don't modify self.message;

fix not existing variable.




git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7855 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 92db785b
...@@ -97,12 +97,13 @@ class Message(Persistent): ...@@ -97,12 +97,13 @@ class Message(Persistent):
if self.domain is None or request is None or translation_service is None : if self.domain is None or request is None or translation_service is None :
# Map the translated string with given parameters # Map the translated string with given parameters
if type(self.mapping) is type({}): if type(self.mapping) is type({}):
if isinstance(self.message, unicode) : message = self.message
self.message = self.message.encode('utf8') if isinstance(message, unicode) :
self.message = Template(self.message).substitute(mapping) message = message.encode('utf8')
if not isinstance(self.message, unicode): message = Template(message).substitute(self.mapping)
self.message = self.message.decode('utf8') if not isinstance(message, unicode):
return self.message message = message.decode('utf8')
return message
else: else:
translated_message = translation_service.translate( translated_message = translation_service.translate(
self.domain, self.domain,
......
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