COVIDSafe code from version 1.9 (#18)

This commit is contained in:
COVIDSafe Support 2020-08-03 16:01:39 +10:00 committed by GitHub
parent 2257c542ed
commit 3b1d8fa3f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 4217 additions and 3998 deletions

56
scripts/lokalise.sh Normal file
View file

@ -0,0 +1,56 @@
LOKALISE_TOKEN=$1
lokalise2 --token $LOKALISE_TOKEN --project-id 961497065ee6ad1e440843.11368444 file download --format strings --dest ../temp --unzip-to ../temp/locales
for directory in `find ../temp/locales -type d`
do
if [[ "$directory" == '../temp/locales' ]]; then
continue
fi
#get the language code to match iOS naming
language="$(basename "$directory")"
language=${language/.lproj/}
#if italian or greek remove anything after the -
if [[ "$language" == 'it-IT' || "$language" == 'el-GR' ]]; then
language=${language//\-[a-zA-z]*/}
fi
echo "parsing directory $directory"
for file in `find $directory/*.strings`; do
filename="$(basename "$file")"
# ignore the Localizable and LaunchScreen files
if [[ "$filename" == 'LaunchScreen.strings' ]]; then
rm $file
continue
fi
if [[ "$filename" == 'Localizable.strings' ]]; then
continue
fi
if [[ "$filename" == 'InfoPlist.strings' ]]; then
echo "Adding launch screen value to $language"
echo -e "\"UILaunchStoryboardName\" = \"LaunchScreen_$language\";" >> $file
continue
fi
echo "Contatenating $filename to Localizable.strings"
cat "$file" >> "$directory/Localizable.strings"
echo "Deleting $file"
rm $file
done
echo "Done preparing files, starting copy"
for file in `find $directory/*.strings`; do
destinationFolder="../CovidSafe/$language.lproj"
cp $file $destinationFolder
echo "Copy files to project directory"
done
done
rm -r ../temp/locales