From 7db37345f769b100e118c26d8f7b0097165b6194 Mon Sep 17 00:00:00 2001 From: Vincent Texier <vit@free.fr> Date: Tue, 12 May 2015 08:48:51 +0200 Subject: [PATCH] Fix bugs in gen_translations.py --- gen_translations.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gen_translations.py b/gen_translations.py index cbc6afa4..b5c5a57e 100644 --- a/gen_translations.py +++ b/gen_translations.py @@ -3,11 +3,14 @@ import sys, os, multiprocessing, subprocess, time gen_resources = os.path.abspath(os.path.join(os.path.dirname(__file__), 'src')) ts = os.path.abspath(os.path.join(os.path.dirname(__file__), 'res', 'i18n', 'ts')) qm = os.path.abspath(os.path.join(os.path.dirname(__file__), 'res', 'i18n', 'qm')) +if not os.path.exists(qm): + os.mkdir(qm) translations = [] qm_files = [] qm_shortnames = [] + def prepare_qm(): for root, dirs, files in os.walk(ts): for f in files: @@ -23,9 +26,11 @@ def prepare_qm(): print(os.path.join(root, f)) for (ts_file, qm_file) in translations: - subprocess.call(["lrelease-qt5", ts_file, "-qm", qm_file]) + # avoid conflict with qt4 lrelease by running qtchooser directly + subprocess.call(["qtchooser", "-run-tool=lrelease", "-qt=5", ts_file, "-qm", qm_file]) print(ts_file + " >> " + qm_file) + def build_resources(): files = "" for file in qm_shortnames: -- GitLab