Upload values folders and their respective strings.xml files to Get Localization. Prerequisites: - You have project already on Get Localization
- Master file strings.xml already exists.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Path to your Android project res directory, it should contain the values directories. | |
RES_PATH=res/* | |
# Get Localization settings | |
USERNAME=u | |
PASSWORD=p | |
PROJECT=yourProject | |
for f in $RES_PATH | |
do | |
if [[ "$f" == *values-* ]] | |
then | |
iana=${f#*-} | |
# Check whether this iana code contains regional variant, remove the r | |
if [[ "$iana" == *-r* ]] | |
then | |
iana=${iana%%-r*}-${iana#*-r} | |
fi | |
echo "Uploading $f to project $iana" | |
curl --form file=@$f/strings.xml --user $USERNAME:$PASSWORD https://api.getlocalization.com/$PROJECT/api/translations/file/strings.xml/$iana/ | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment