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):
if self.domain is None or request is None or translation_service is None :
# Map the translated string with given parameters
if type(self.mapping) is type({}):
if isinstance(self.message, unicode) :
self.message = self.message.encode('utf8')
self.message = Template(self.message).substitute(mapping)
if not isinstance(self.message, unicode):
self.message = self.message.decode('utf8')
return self.message
message = self.message
if isinstance(message, unicode) :
message = message.encode('utf8')
message = Template(message).substitute(self.mapping)
if not isinstance(message, unicode):
message = message.decode('utf8')
return message
else:
translated_message = translation_service.translate(
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