Skip to content

Instantly share code, notes, and snippets.

@joeydebreuk
Created February 14, 2020 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joeydebreuk/6319e598cfacd081f9290ffe2dc643f1 to your computer and use it in GitHub Desktop.
Save joeydebreuk/6319e598cfacd081f9290ffe2dc643f1 to your computer and use it in GitHub Desktop.
Download export from Translationhut
#!/bin/bash
SECRET=YOURSECRET
WRITE_TO_DIR=src/messages
URL="https://translationhut.com/export/flat_json?languages=EN-US,NL-NL&include_empty=false"
# Download file to messages.zip
curl "$URL" -H "Authorization: Api-Key $SECRET" --output messages.zip
# unzip messages.zip to relative path folder, declared in "WRITE_TO_DIR"
# -o flag will make unzip overwrite destination files
unzip -o messages -d $WRITE_TO_DIR;
if [[ $? != 0 ]];
then
# If something went wrong, log the downloaded files,
# since it will most likely contain errors
printf '\n\nSomething went wrong.\n'
cat messages.zip;
fi;
rm messages.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment