diff options
author | Antti Kokko <antti.kokko@qt.io> | 2021-11-19 15:12:48 +0200 |
---|---|---|
committer | Antti Kokko <antti.kokko@qt.io> | 2021-12-16 07:51:25 +0000 |
commit | f21670e66deca92d21ceed33857033b6a4bd3191 (patch) | |
tree | 5487b51cc7dced02e157b34e80ae6de6e21b2a02 | |
parent | b96be05c0192d377a149158b2d914820fb801674 (diff) |
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 <akseli.salovaara@qt.io>
-rw-r--r-- | packaging-tools/create_installer.py | 9 | ||||
-rwxr-xr-x[-rw-r--r--] | packaging-tools/update_component_translations.sh | 0 |
2 files changed, 8 insertions, 1 deletions
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 index 970aa69aa..970aa69aa 100644..100755 --- a/packaging-tools/update_component_translations.sh +++ b/packaging-tools/update_component_translations.sh |