2021-02-25 08:46:32 +01:00
|
|
|
#!/bin/zsh
|
|
|
|
|
2021-08-06 09:47:03 +02:00
|
|
|
set -ev
|
|
|
|
|
2024-03-06 17:12:34 +01:00
|
|
|
SRCROOT=$(pwd)
|
2021-02-25 09:50:37 +01:00
|
|
|
|
2021-02-25 08:46:32 +01:00
|
|
|
echo ${SRCROOT}
|
2021-08-06 09:47:03 +02:00
|
|
|
|
2022-11-14 18:44:28 +01:00
|
|
|
# Task 1
|
|
|
|
# here we use the template source as input to
|
2024-03-06 17:12:34 +01:00
|
|
|
# generate strings so we could use new strings
|
2022-11-14 18:44:28 +01:00
|
|
|
# before sync to Crowdin
|
|
|
|
|
|
|
|
# clean Base.lproj
|
|
|
|
rm -rf ${SRCROOT}/Localization/StringsConvertor/input/Base.lproj
|
|
|
|
# copy tempate sources
|
|
|
|
mkdir ${SRCROOT}/Localization/StringsConvertor/input/Base.lproj
|
|
|
|
cp ${SRCROOT}/Localization/app.json ${SRCROOT}/Localization/StringsConvertor/input/Base.lproj/app.json
|
|
|
|
cp ${SRCROOT}/Localization/ios-infoPlist.json ${SRCROOT}/Localization/StringsConvertor/input/Base.lproj/ios-infoPlist.json
|
|
|
|
cp ${SRCROOT}/Localization/Localizable.stringsdict ${SRCROOT}/Localization/StringsConvertor/input/Base.lproj/Localizable.stringsdict
|
|
|
|
|
|
|
|
# Task 2 generate strings file
|
2021-02-25 08:46:32 +01:00
|
|
|
cd ${SRCROOT}/Localization/StringsConvertor
|
|
|
|
sh ./scripts/build.sh
|
|
|
|
|
2022-11-14 18:44:28 +01:00
|
|
|
# Task 3 copy strings file
|
2022-11-16 13:02:09 +01:00
|
|
|
cp -R ${SRCROOT}/Localization/StringsConvertor/output/main/ ${SRCROOT}/Mastodon/Resources
|
2022-01-27 14:23:39 +01:00
|
|
|
cp -R ${SRCROOT}/Localization/StringsConvertor/output/module/ ${SRCROOT}/MastodonSDK/Sources/MastodonLocalization/Resources
|
2021-08-06 09:47:03 +02:00
|
|
|
cp -R ${SRCROOT}/Localization/StringsConvertor/Intents/output/ ${SRCROOT}/MastodonIntent
|
2021-02-25 08:46:32 +01:00
|
|
|
|
2022-11-14 18:44:28 +01:00
|
|
|
# Task 4 swiftgen
|
2021-02-25 08:46:32 +01:00
|
|
|
cd ${SRCROOT}
|
2024-03-06 17:12:34 +01:00
|
|
|
if which swiftgen >/dev/null; then
|
|
|
|
swiftgen
|
2021-02-25 08:46:32 +01:00
|
|
|
else
|
2024-03-06 17:12:34 +01:00
|
|
|
echo "Run 'brew install swiftgen'."
|
2021-02-25 08:46:32 +01:00
|
|
|
fi
|
|
|
|
|
2022-11-14 18:44:28 +01:00
|
|
|
# Task 5 clean temp file
|
2021-02-25 08:46:32 +01:00
|
|
|
rm -rf ${SRCROOT}/Localization/StringsConvertor/output
|
2021-08-06 09:47:03 +02:00
|
|
|
rm -rf ${SRCROOT}/Localization/StringsConvertor/intents/output
|