Commit 5cddc4d8 authored by Jérome Perrin's avatar Jérome Perrin

Explicily encode the unicode object from gettext to utf8, to prevent

implicit encode in ascii which will fail with non ascii chars.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5869 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2d3e4a34
......@@ -65,7 +65,9 @@ def Localizer_translate(self, domain, msgid, mapping=None, *args, **kw):
# Map the translated string with given parameters
if type(mapping) is type({}):
return Template(translated_str).substitute(mapping)
if isinstance(translated_str, unicode) :
translated_str = translated_str.encode('utf8')
return unicode(Template(translated_str).substitute(mapping), 'utf8')
return translated_str
def GlobalTranslationService_translate(self, domain, msgid, *args, **kw):
......
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