# HG changeset patch # User Julien Cristau # Date 1444060623 -7200 # Node ID b1834143fec84786844fda104b0cae8122c154d0 # Parent 4b3c1069bd4e88491869bade792f923c764d52b8 [py3k] fix i18n diff -r 4b3c1069bd4e -r b1834143fec8 i18n.py --- a/i18n.py Tue Oct 06 11:44:51 2015 +0200 +++ b/i18n.py Mon Oct 05 17:57:03 2015 +0200 @@ -25,6 +25,8 @@ from os.path import join, basename, splitext, exists from glob import glob +from six import PY2 + from cubicweb.toolsutils import create_dir def extract_from_tal(files, output_file): @@ -40,10 +42,10 @@ def add_msg(w, msgid, msgctx=None): """write an empty pot msgid definition""" - if isinstance(msgid, unicode): + if PY2 and isinstance(msgid, unicode): msgid = msgid.encode('utf-8') if msgctx: - if isinstance(msgctx, unicode): + if PY2 and isinstance(msgctx, unicode): msgctx = msgctx.encode('utf-8') w('msgctxt "%s"\n' % msgctx) msgid = msgid.replace('"', r'\"').splitlines()