diff --git a/contrib/locale/push_locale.py b/contrib/locale/push_locale.py index 86b855434..18eb18f24 100755 --- a/contrib/locale/push_locale.py +++ b/contrib/locale/push_locale.py @@ -71,6 +71,7 @@ with open(f"{build_dir}/qml.lst", "wb") as f: print("Found {} QML files to translate".format(len(files.splitlines()))) +# note: lupdate writes relative paths into its output .ts file, relative to the .ts file itself :/ cmd = [QT_LUPDATE, f"@{build_dir}/qml.lst","-ts", f"{build_dir}/qml.ts"] print('Collecting strings') subprocess.check_output(cmd) @@ -79,6 +80,12 @@ cmd = [QT_LCONVERT, "-of", "po", "-o", f"{build_dir}/messages_qml.pot", f"{build print('Convert to gettext') subprocess.check_output(cmd) +print("Fixing some paths in messages_qml.pot") +# sed from " ../../gui/qml/" +# to " electrum/gui/qml/" +cmd = ["sed", "-i", r"s/ ..\/..\/gui\/qml\// electrum\/gui\/qml\//g", f"{build_dir}/messages_qml.pot"] +subprocess.check_output(cmd) + cmd = ["msgcat", "-u", "-o", f"{build_dir}/messages.pot", f"{build_dir}/messages_gettext.pot", f"{build_dir}/messages_qml.pot"] print('Generate template') subprocess.check_output(cmd)