Commit c5ac6eb9 authored by Carlos Ramos Carreño's avatar Carlos Ramos Carreño

Fix `po_import` behavior in Python 2

See merge request erp5!1929
parents f9b3c7ae cb64370a
Pipeline #34209 failed with stage
in 0 seconds
...@@ -660,10 +660,8 @@ class MessageCatalog(LanguageManager, ObjectManager, SimpleItem): ...@@ -660,10 +660,8 @@ class MessageCatalog(LanguageManager, ObjectManager, SimpleItem):
messages = self._messages messages = self._messages
# Load the data # Load the data
if isinstance(data, bytes): # six.PY2 if isinstance(data, bytes):
pass data = data.decode("utf-8")
elif isinstance(data, bytes): # six.PY3
data = data.decode()
po = polib.pofile(data) po = polib.pofile(data)
encoding = to_str(po.encoding) encoding = to_str(po.encoding)
for entry in po: for entry in po:
......
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