Add script to pull Crowdin translations
This commit is contained in:
parent
ecb4a8a4ba
commit
1f34061e3e
1 changed files with 22 additions and 0 deletions
22
script/crowdin-pull
Executable file
22
script/crowdin-pull
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
PROJECT=foodsoft
|
||||||
|
|
||||||
|
if [ ! "${CROWDIN_API_KEY}" ]; then
|
||||||
|
echo "Please set CROWDIN_API_KEY to download all translations." 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# build archive
|
||||||
|
wget -q -O/dev/null "https://api.crowdin.com/api/project/${PROJECT}/export?key=${CROWDIN_API_KEY}"
|
||||||
|
|
||||||
|
# download all translations
|
||||||
|
TMPDIR=$(mktemp -d -t "crowdin-${PROJECT}-XXXXXXXXXX")
|
||||||
|
wget -q -O "${TMPDIR}/all.zip" "https://api.crowdin.com/api/project/${PROJECT}/download/all.zip?key=${CROWDIN_API_KEY}"
|
||||||
|
|
||||||
|
# extract, but strip 'master' component
|
||||||
|
ln -s $(pwd) "${TMPDIR}/master"
|
||||||
|
unzip -o -d "${TMPDIR}" "${TMPDIR}/all.zip"
|
||||||
|
|
||||||
|
rm -f "${TMPDIR}/all.zip" "${TMPDIR}/master"
|
||||||
|
rmdir "${TMPDIR}"
|
Loading…
Reference in a new issue