2024-08-26 10:13:52 -04:00
|
|
|
#!/bin/bash
|
chore: Add localization support for Chinese (Traditional), Japanese, Korean, German, French, Spanish, Russian, Italian, Portuguese, Vietnamese, Thai, Arabic, Dutch, Swedish, Polish, and Turkish
This commit adds localization support for multiple languages by including translations in Chinese (Traditional), Japanese, Korean, German, French, Spanish, Russian, Italian, Portuguese, Vietnamese, Thai, Arabic, Dutch, Swedish, Polish, and Turkish. The locales configuration script has been updated to set the language environment variables for improved localization support. It adds the LC_ALL, LC_NUMERIC, LC_TIME, LC_MONETARY, LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEASUREMENT, and LC_IDENTIFICATION variables to the /etc/default/locale file. These changes enhance the installation process and ensure proper setup of the language settings.
2024-08-27 01:07:12 +00:00
|
|
|
set -e # exit on error
|
|
|
|
set -o pipefail # exit on pipeline error
|
|
|
|
set -u # treat unset variable as error
|
2024-08-26 10:13:52 -04:00
|
|
|
|
2024-09-14 08:18:57 +00:00
|
|
|
LANG_MODES=( "en_US" "zh_CN" "zh_TW" "zh_HK" "ja_JP" "ko_KR" "vi_VN" "th_TH" "de_DE" "fr_FR" "es_ES" "ru_RU" "it_IT" "pt_PT" "pt_BR" "ar_SA" "nl_NL" "sv_SE" "pl_PL" "tr_TR")
|
|
|
|
LANG_PACK_CODES=("en" "zh" "zh" "zh" "ja" "ko" "vi" "th" "de" "fr" "es" "ru" "it" "pt" "pt" "ar" "nl" "sv" "pl" "tr")
|
2024-08-26 10:13:52 -04:00
|
|
|
|
2024-12-28 08:11:34 +00:00
|
|
|
|
|
|
|
# Define versions, code names, and kernels
|
|
|
|
VERSIONS=( "1.1.0" "1.2.0")
|
|
|
|
CODE_NAME=( "noble" "oracular")
|
2024-12-28 08:12:19 +00:00
|
|
|
KERNELS=( "linux-generic-hwe-24.04" "linux-generic-hwe-24.04")
|
2024-12-28 08:11:34 +00:00
|
|
|
|
|
|
|
# Check if required files exist
|
2024-08-26 10:13:52 -04:00
|
|
|
if [[ ! -f "args.sh" || ! -f "build.sh" ]]; then
|
|
|
|
echo "Error: args.sh or build.sh not found."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-12-28 08:11:34 +00:00
|
|
|
# Check if the lengths of VERSIONS, CODE_NAME, and KERNELS arrays are consistent
|
|
|
|
if [[ ${#VERSIONS[@]} -ne ${#CODE_NAME[@]} || ${#VERSIONS[@]} -ne ${#KERNELS[@]} ]]; then
|
|
|
|
echo "Error: The lengths of VERSIONS, CODE_NAME, and KERNELS arrays are inconsistent."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Record the total number of builds
|
|
|
|
TOTAL_BUILDS=$(( ${#VERSIONS[@]} * ${#LANG_MODES[@]} ))
|
|
|
|
CURRENT_BUILD=1
|
|
|
|
|
|
|
|
# Outer loop iterates over each version
|
|
|
|
for i in "${!VERSIONS[@]}"; do
|
|
|
|
VERSION="${VERSIONS[$i]}"
|
|
|
|
CODE="${CODE_NAME[$i]}"
|
|
|
|
KERNEL="${KERNELS[$i]}"
|
|
|
|
|
|
|
|
# Update the version, code name, and kernel in args.sh
|
|
|
|
sed -i "s/^export TARGET_BUILD_VERSION=\".*\"/export TARGET_BUILD_VERSION=\"${VERSION}\"/" args.sh
|
|
|
|
sed -i "s/^export TARGET_UBUNTU_VERSION=\".*\"/export TARGET_UBUNTU_VERSION=\"${CODE}\"/" args.sh
|
|
|
|
sed -i "s/^export TARGET_KERNEL_PACKAGE=\".*\"/export TARGET_KERNEL_PACKAGE=\"${KERNEL}\"/" args.sh
|
|
|
|
|
|
|
|
echo "=============================================="
|
|
|
|
echo "Starting build for Version: ${VERSION}, Code Name: ${CODE}, Kernel: ${KERNEL}"
|
|
|
|
echo "=============================================="
|
|
|
|
|
|
|
|
# Inner loop iterates over each language mode
|
|
|
|
for j in "${!LANG_MODES[@]}"; do
|
|
|
|
LANG_MODE="${LANG_MODES[$j]}"
|
|
|
|
LANG_CODE="${LANG_PACK_CODES[$j]}"
|
|
|
|
|
|
|
|
# Update the language mode and language code in args.sh
|
|
|
|
sed -i "s/^export LANG_MODE=\".*\"/export LANG_MODE=\"${LANG_MODE}\"/" args.sh
|
|
|
|
sed -i "s/^export LANG_PACK_CODE=\".*\"/export LANG_PACK_CODE=\"${LANG_CODE}\"/" args.sh
|
|
|
|
|
|
|
|
# Build identifier
|
|
|
|
BUILD_IDENTIFIER="${VERSION}-${CODE}-${KERNEL}-${LANG_MODE}"
|
|
|
|
echo "Build progress ${CURRENT_BUILD}/${TOTAL_BUILDS}: ${BUILD_IDENTIFIER}"
|
|
|
|
|
|
|
|
# Execute build
|
|
|
|
./build.sh
|
|
|
|
|
|
|
|
((CURRENT_BUILD++))
|
|
|
|
done
|
2024-08-26 10:13:52 -04:00
|
|
|
done
|
2024-12-28 08:11:34 +00:00
|
|
|
|
|
|
|
echo "All build tasks have been completed."
|