From f21670e66deca92d21ceed33857033b6a4bd3191 Mon Sep 17 00:00:00 2001 From: Antti Kokko Date: Fri, 19 Nov 2021 15:12:48 +0200 Subject: Add support for creating translation .qm files for component Create translation binary files when building online repositories if the translation source files exist for the component. Change file permissions for update_component_translation.sh script. Change-Id: I97beb73579eaf2a5a726b23ff6d65191310695db Reviewed-by: Akseli Salovaara --- packaging-tools/create_installer.py | 9 ++++++++- packaging-tools/update_component_translations.sh | 0 2 files changed, 8 insertions(+), 1 deletion(-) mode change 100644 => 100755 packaging-tools/update_component_translations.sh diff --git a/packaging-tools/create_installer.py b/packaging-tools/create_installer.py index 9c57d1d7f..15b016fc6 100644 --- a/packaging-tools/create_installer.py +++ b/packaging-tools/create_installer.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ############################################################################# ## -## Copyright (C) 2020 The Qt Company Ltd. +## Copyright (C) 2021 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the release tools of the Qt Toolkit. @@ -966,6 +966,10 @@ def create_target_components(target_config): print '= Creating SDK components' print '=================================================================' print '' + # download and extract lrelease binary for creating translation binaries + if not os.path.isfile(os.path.join(SCRIPT_ROOT_DIR, "lrelease")) and bldinstallercommon.is_linux_platform(): + bld_utils.download(os.environ.get("LRELEASE_TOOL"), SCRIPT_ROOT_DIR) + bldinstallercommon.extract_file(os.path.basename(os.environ.get("LRELEASE_TOOL")), SCRIPT_ROOT_DIR) getComponentDataWork = ThreadedWork("get components data") for sdk_component in SDK_COMPONENT_LIST: # check first for top level component @@ -985,6 +989,9 @@ def create_target_components(target_config): # Copy Meta data metadata_content_source_root = os.path.normpath(sdk_component.pkg_template_dir + os.sep + 'meta') bldinstallercommon.copy_tree(metadata_content_source_root, meta_dir_dest) + if CREATE_REPOSITORY and os.path.isfile(os.path.join(SCRIPT_ROOT_DIR, "lrelease")): + # create translation binaries, files are created if translation source files exist for component + subprocess.check_call([os.path.join(SCRIPT_ROOT_DIR, "update_component_translations.sh"), "-r", os.path.join(SCRIPT_ROOT_DIR, "lrelease"), dest_base]) # add files into tag substitution GENERAL_TAG_SUBST_LIST.append(meta_dir_dest) # handle archives diff --git a/packaging-tools/update_component_translations.sh b/packaging-tools/update_component_translations.sh old mode 100644 new mode 100755 -- cgit v1.2.3