diff --git a/scripts/deploy.py b/scripts/deploy.py index 847dc853104..17460930bf8 100755 --- a/scripts/deploy.py +++ b/scripts/deploy.py @@ -210,14 +210,14 @@ def add_qt_conf(target_path, qt_prefix_path): f.write('Qml2Imports=qml\n') f.close() -def copy_translations(install_dir, qt_tr_dir): - translations = glob(os.path.join(qt_tr_dir, '*.qm')) - tr_dir = os.path.join(install_dir, 'share', 'qtcreator', 'translations') - - print("copying translations...") +def deploy_translations(qtc_binary_path, qt_install): + print("Copying translations...") + translations = glob(os.path.join(qt_install.translations, '*.qm')) + destdir = (os.path.join(qtc_binary_path, 'Contents', 'Resources', 'translations') if common.is_mac_platform() + else os.path.join(qtc_binary_path, '..', 'share', 'qtcreator', 'translations')) for translation in translations: - print(translation, '->', tr_dir) - shutil.copy(translation, tr_dir) + print(translation, '->', destdir) + shutil.copy(translation, destdir) def copyPreservingLinks(source, destination): if os.path.islink(source): @@ -386,6 +386,7 @@ def main(): deploy_qtdiag(qtcreator_binary_path, qt_install) deploy_plugins(qtcreator_binary_path, qt_install) deploy_imports(qtcreator_binary_path, qt_install) + deploy_translations(qtcreator_binary_path, qt_install) if common.is_mac_platform(): deploy_mac(args) @@ -401,7 +402,7 @@ def main(): copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.bin) else: copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.lib) - copy_translations(install_dir, qt_install.translations) + if args.llvm_path: deploy_clang(install_dir, args.llvm_path, chrpath_bin) diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh index 52e683d990d..b58d213138e 100755 --- a/scripts/deployqtHelper_mac.sh +++ b/scripts/deployqtHelper_mac.sh @@ -10,7 +10,6 @@ app_path="$1" resource_path="$app_path/Contents/Resources" libexec_path="$app_path/Contents/Resources/libexec" bin_src="$2" -translation_src="$3" echo "Deploying Qt" @@ -32,13 +31,6 @@ if [ ! -f "$libexec_path/ios/qt.conf" ]; then cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/ios_qt.conf" "$libexec_path/ios/qt.conf" || exit 1 fi -# copy Qt translations -# check for known existing translation to avoid copying multiple times -if [ ! -f "$resource_path/translations/qt_de.qm" ]; then - echo "- Copying Qt translations" - cp "$translation_src"/*.qm "$resource_path/translations/" || exit 1 -fi - # copy clang if needed if [ $LLVM_INSTALL_DIR ]; then if [ "$LLVM_INSTALL_DIR"/bin/clangd -nt "$libexec_path"/clang/bin/clangd ]; then