-
Notifications
You must be signed in to change notification settings - Fork 10
/
update_localization.sh
executable file
·48 lines (35 loc) · 1.21 KB
/
update_localization.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/zsh
set -ev
SRCROOT=`pwd`
PODS_ROOT='Pods'
echo ${SRCROOT}
# download translation resources
mkdir -p ./Localization/Crowdin
crowdin download --all --config ./crowdin-download.yml
# # prepare resources
INPUT_DIR="${SRCROOT}/Localization/StringsConvertor/input"
echo "Prepare resources at ${INPUT_DIR}"
if [[ -d ${INPUT_DIR} ]]; then
rm -rf ${INPUT_DIR}
fi
cp -R ${SRCROOT}/Localization/Crowdin/translation/ ${INPUT_DIR}
# convert resources
cd ${SRCROOT}/Localization/StringsConvertor
sh ./scripts/build.sh
# copy strings
cp -R ${SRCROOT}/Localization/StringsConvertor/output/module/ ${SRCROOT}/TwidereSDK/Sources/TwidereLocalization/Resources
cp -R ${SRCROOT}/Localization/StringsConvertor/output/main/ ${SRCROOT}/TwidereX/Resources
cp -R ${SRCROOT}/Localization/StringsConvertor/output/TwidereXIntent/ ${SRCROOT}/TwidereXIntent
# cleanup input & output
sh ./scripts/cleanup.sh
# swiftgen
cd ${SRCROOT}
echo "${PODS_ROOT}/SwiftGen/bin/swiftgen"
if [[ -f "${PODS_ROOT}/SwiftGen/bin/swiftgen" ]] then
"${PODS_ROOT}/SwiftGen/bin/swiftgen"
else
echo "Run 'pod install' or update your CocoaPods installation."
fi
# cleanup translation resources
cd ${SRCROOT}
rm -rf ${SRCROOT}/Localization/Crowdin/translation