Commit 45ae39d6 authored by Jérome Perrin's avatar Jérome Perrin

do not encode messages that are not unicode. This cause problem for usages like

Base_translateString("hé") when "hé" is not translated


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40687 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1e8517c9
......@@ -62,9 +62,13 @@ if translation_service is not None :\n
try:\n
if not encoding:\n
return translation_service.translate(catalog, msg, lang=lang, **kw)\n
return translation_service.translate(catalog, msg, lang=lang, **kw).encode(encoding)\n
msg = translation_service.translate(catalog, msg, lang=lang, **kw)\n
if same_type(msg, u\'\'):\n
msg = msg.encode(encoding)\n
return msg\n
except AttributeError: # This happens in unit testing, because it is not able to find something with get_context()\n
pass\n
\n
return msg\n
</string> </value>
</item>
......@@ -114,6 +118,7 @@ return msg\n
<string>translation_service</string>
<string>_apply_</string>
<string>_getattr_</string>
<string>same_type</string>
<string>AttributeError</string>
</tuple>
</value>
......
1798
\ No newline at end of file
1799
\ No newline at end of file
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