Merge pull request #327 from senbrow/patch-1

Update locale.sh to run in parallel for 100x speedup on launch
This commit is contained in:
Steve Zabka
2023-05-31 18:02:00 +02:00
committed by GitHub

View File

@@ -7,64 +7,72 @@
# Author URI: https://cryinkfly.com #
# License: MIT #
# Copyright (c) 2020-2022 #
# Time/Date: 16:00/13.09.2022 #
# Version: 1.5.1 #
# Time/Date: 18:00/31.05.2023 #
# Version: 1.5.2 #
####################################################################################################
###############################################################################################################################################################
# ALL FUNCTIONS ARE ARRANGED HERE: #
###############################################################################################################################################################
# Load & Save the locale files into the folders!
declare -rA _LOCALES=(
[cs]="CZ"
[de]="DE"
[en]="US"
[es]="ES"
[fr]="FR"
[it]="IT"
[ja]="JP"
[ko]="KR"
[zh]="CN"
)
# Load & Save the locale files into the folders (asynchronously)!
# Use the `wait` keyword after to block until completed.
function load-locale-languages {
wget -N -P $SP_PATH/locale/cs-CZ/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/cs-CZ/locale-cs.sh
chmod +x $SP_PATH/locale/cs-CZ/locale-cs.sh
wget -N -P $SP_PATH/locale/de-DE/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/de-DE/locale-de.sh
chmod +x $SP_PATH/locale/de-DE/locale-de.sh
wget -N -P $SP_PATH/locale/en-US/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/en-US/locale-en.sh
chmod +x $SP_PATH/locale/en-US/locale-en.sh
wget -N -P $SP_PATH/locale/es-ES/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/es-ES/locale-es.sh
chmod +x $SP_PATH/locale/es-ES/locale-es.sh
wget -N -P $SP_PATH/locale/fr-FR/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/fr-FR/locale-fr.sh
chmod +x $SP_PATH/locale/fr-FR/locale-fr.sh
wget -N -P $SP_PATH/locale/it-IT/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/it-IT/locale-it.sh
chmod +x $SP_PATH/locale/it-IT/locale-it.sh
wget -N -P $SP_PATH/locale/ja-JP/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/ja-JP/locale-ja.sh
chmod +x $SP_PATH/locale/ja-JP/locale-ja.sh
wget -N -P $SP_PATH/locale/ko-KR/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/ko-KR/locale-ko.sh
chmod +x $SP_PATH/locale/ko-KR/locale-ko.sh
wget -N -P $SP_PATH/locale/zh-CN/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/zh-CN/locale-zh.sh
chmod +x $SP_PATH/locale/zh-CN/locale-zh.sh
for lang in "${!_LOCALES[@]}"
do
country="${_LOCALES[$lang]}"
(
wget -N -P \
"$SP_PATH/locale/$lang-$country" \
"https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/$lang-$country/locale-$lang.sh" \
&& chmod +x "$SP_PATH/locale/$lang-$country/locale-$lang.sh"
) &
done
}
###############################################################################################################################################################
# Load & Save the translations of the licenses into the folders!
# Load & Save the translations of the licenses into the folders asynchronously!
# Use the `wait` keyword after to block until completed.
function load-locale-licenses {
wget -N -P $SP_PATH/locale/cs-CZ/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/cs-CZ/license-cs.txt
wget -N -P $SP_PATH/locale/de-DE/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/de-DE/license-de.txt
wget -N -P $SP_PATH/locale/en-US/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/en-US/license-en.txt
wget -N -P $SP_PATH/locale/es-ES/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/es-ES/license-es.txt
wget -N -P $SP_PATH/locale/fr-FR/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/fr-FR/license-fr.txt
wget -N -P $SP_PATH/locale/it-IT/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/it-IT/license-it.txt
wget -N -P $SP_PATH/locale/ja-JP/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/ja-JP/license-ja.txt
wget -N -P $SP_PATH/locale/ko-KR/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/ko-KR/license-ko.txt
wget -N -P $SP_PATH/locale/zh-CN/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/zh-CN/license-zh.txt
for lang in "${!_LOCALES[@]}"
do
country="${_LOCALES[$lang]}"
wget -N -P \
"$SP_PATH/locale/$lang-$country" \
"https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/$lang-$country/license-$lang.txt" \
&
done
}
###############################################################################################################################################################
# Load & Save the translations of the extensions into the folders!
# Load & Save the translations of the extensions into the folders
# asynchronously! Use the `wait` keyword after to block until completed.
function load-locale-extensions {
wget -N -P $SP_PATH/locale/cs-CZ/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/cs-CZ/extensions-cs.txt
wget -N -P $SP_PATH/locale/de-DE/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/de-DE/extensions-de.txt
wget -N -P $SP_PATH/locale/en-US/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/en-US/extensions-en.txt
wget -N -P $SP_PATH/locale/es-ES/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/es-ES/extensions-es.txt
wget -N -P $SP_PATH/locale/fr-FR/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/fr-FR/extensions-fr.txt
wget -N -P $SP_PATH/locale/it-IT/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/it-IT/extensions-it.txt
wget -N -P $SP_PATH/locale/ja-JP/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/ja-JP/extensions-ja.txt
wget -N -P $SP_PATH/locale/ko-KR/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/ko-KR/extensions-ko.txt
wget -N -P $SP_PATH/locale/zh-CN/ https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/zh-CN/extensions-zh.txt
for lang in "${!_LOCALES[@]}"
do
country="${_LOCALES[$lang]}"
wget -N -P \
"$SP_PATH/locale/$lang-$country" \
"https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/builds/stable-branch/locale/$lang-$country/extensions-$lang.txt" \
&
done
}
###############################################################################################################################################################
@@ -74,3 +82,4 @@ function load-locale-extensions {
load-locale-languages
load-locale-licenses
load-locale-extensions
wait