mastodon-ios/update_localization.sh

43 lines
1.4 KiB
Bash
Raw Normal View History

#!/bin/zsh
set -ev
SRCROOT=`pwd`
2021-02-25 09:50:37 +01:00
PODS_ROOT='Pods'
echo ${SRCROOT}
2022-11-14 18:44:28 +01:00
# Task 1
# here we use the template source as input to
# generate strings so we could use new strings
# 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
cd ${SRCROOT}/Localization/StringsConvertor
sh ./scripts/build.sh
2022-11-14 18:44:28 +01:00
# Task 3 copy strings file
cp -R ${SRCROOT}/Localization/StringsConvertor/output/module/ ${SRCROOT}/MastodonSDK/Sources/MastodonLocalization/Resources
cp -R ${SRCROOT}/Localization/StringsConvertor/Intents/output/ ${SRCROOT}/MastodonIntent
2022-11-14 18:44:28 +01:00
# Task 4 swiftgen
cd ${SRCROOT}
2021-02-25 09:50:37 +01:00
echo "${PODS_ROOT}/SwiftGen/bin/swiftgen"
if [[ -f "${PODS_ROOT}/SwiftGen/bin/swiftgen" ]] then
"${PODS_ROOT}/SwiftGen/bin/swiftgen"
else
echo "Run 'bundle exec pod install' or update your CocoaPods installation."
fi
2022-11-14 18:44:28 +01:00
# Task 5 clean temp file
rm -rf ${SRCROOT}/Localization/StringsConvertor/output
rm -rf ${SRCROOT}/Localization/StringsConvertor/intents/output