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

No need to coerce string types if mapping is empty


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7251 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a110730b
......@@ -63,7 +63,7 @@ def Localizer_translate(self, domain, msgid, mapping=None, *args, **kw):
translated_str = catalog_obj.gettext(msgid, **params)
# Map the translated string with given parameters
if type(mapping) is type({}):
if type(mapping) is type({}) and len(mapping):
unicode_mapping = {}
if not isinstance(translated_str, unicode):
translated_str = translated_str.decode('utf8')
......
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