From b7aa1a00d7285c1f28c5b20916f34d4b61c2b0b5 Mon Sep 17 00:00:00 2001 From: HackerNCoder Date: Tue, 7 Mar 2023 22:49:32 +0100 Subject: [PATCH] Further update tl2po for python3 --- tl2po.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tl2po.py b/tl2po.py index a691669..045ff1a 100755 --- a/tl2po.py +++ b/tl2po.py @@ -96,7 +96,7 @@ def tl2po(projectpath, language, outfile=None): occurrences[s['text']] = occurrences.get(s['text'], 0) + 1 out = io.open(outfile, 'w', encoding='utf-8') - out.write(ur"""msgid "" + out.write(r"""msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -108,7 +108,7 @@ msgstr "" if occurrences[s['text']] > 1: out.write(u'msgctxt "' + (s['id'] or s['source']) + u'"\n') out.write('msgid "' + s['text'] + '"\n') - if s['id'] is not None and t_blocks_index.has_key(s['id']): + if s['id'] is not None and s['id'] in t_blocks_index: out.write(u'msgstr "' + (t_blocks_index[s['id']] or '') + u'"\n') else: out.write(u'msgstr "' + t_basestr_index.get(s['text'],'') + u'"\n')