#!/bin/sh

if [ ! "$CROWDIN_API_KEY" ]; then
  echo "Please set CROWDIN_API_KEY" 1>&2
  exit 1
fi

if ! which crowdin >/dev/null; then
  echo "Please install the Crowdin CLI, see https://support.crowdin.com/cli-tool/" 1>&2
  exit 1
fi

# add supported locales here (Crowdin language codes)
for locale in de nl fr es-ES; do
  crowdin pull -b master --tree -l $locale
done
