Don't need the old shell scripts anymore

pull/14/head
Sam Bosley 12 years ago
parent aab7ad3501
commit fb5ecdff6b

@ -1,52 +0,0 @@
#!/bin/bash
STRS=translations/strings.xml
STRS_API=translations/strings-api.xml
if [ $# -ne 1 ]
then
echo "Requires langauge tag or 'master' argument"
exit
fi
rm -f $STRS
rm -f $STRS_API
read -p "Enter GetLocalization username: " user
read -s -p "Enter GetLocalization password: " pw
echo
LANG=$1
if [ "$LANG" == "master" ]
then
# concatenate astrid XML files
catxml="`dirname $0`/catxml"
${catxml} astrid/res/values/strings*.xml > $STRS
# copy api file
cp api/res/values/strings.xml $STRS_API
else
cp astrid/res/values-$LANG/strings.xml $STRS
cp api/res/values-$LANG/strings.xml $STRS_API
fi
# replace \' with '
sed -i '' "s/\\\\'/'/g" $STRS
sed -i '' "s/\\\\'/'/g" $STRS_API
# upload files as master android filesi
if [ "$LANG" == "master" ]
then
curl --form file=@$STRS --user $user:$pw https://api.getlocalization.com/astrid/api/update-master/ ; echo
curl --form file=@$STRS_API --user $user:$pw https://api.getlocalization.com/astrid/api/update-master/ ; echo
else
LANG_MOD=`echo $LANG | sed 's/-r/-/'`
curl --form file=@$STRS --user $user:$pw https://api.getlocalization.com/astrid/api/translations/file/strings.xml/$LANG_MOD/ ; echo
curl --form file=@$STRS_API --user $user:$pw https://api.getlocalization.com/astrid/api/translations/file/strings-api.xml/$LANG_MOD/ ; echo
fi
rm -f $STRS
rm -f $STRS_API

@ -1,47 +0,0 @@
#!/bin/bash
STRS=translations/strings.xml
STRS_API=translations/strings-api.xml
if [ $# -ne 1 ]
then
echo "Requires language tag or 'all' argument"
exit
fi
rm -f $STRS
rm -f $STRS_API
read -p "Enter GetLocalization username: " user
read -s -p "Enter GetLocalization password: " pw
LANG=$1
if [ "$LANG" == "all" ]
then
curl --user $user:$pw https://api.getlocalization.com/astrid/api/translations/zip/ -o translations/all.zip ; echo
mkdir translations/all
tar xzf translations/all.zip -C translations/all
for F in translations/all/*
do
LANG=`basename $F`
STRS=$F/strings.xml
STRS_API=$F/strings-api.xml
sed -i '' "s/'/\\\\'/g" $STRS
sed -i '' "s/'/\\\\'/g" $STRS_API
mv $STRS astrid/res/values-$LANG/strings.xml
mv $STRS_API api/res/values-$LANG/strings.xml
done
rm -rf translations/all
rm translations/all.zip
else
curl --user $user:$pw https://api.getlocalization.com/astrid/api/translations/file/strings.xml/$LANG/ -o $STRS ; echo
curl --user $user:$pw https://api.getlocalization.com/astrid/api/translations/file/strings-api.xml/$LANG/ -o $STRS_API ; echo
mv $STRS astrid/res/values-$LANG/strings.xml
mv $STRS_API api/res/values-$LANG/strings.xml
fi
Loading…
Cancel
Save