#!/bin/bash

if [ -e ~/.transifex.key ]; then
	echo "## portal.json"
	curl -i -L --user api:`cat ~/.transifex.key` \
		-F file=@lemonldap-ng-portal/site/htdocs/static/languages/en.json \
		-X PUT https://www.transifex.com/api/2/project/lemonldapng/resource/portaljson/content/
	echo

	echo "## manager.json"
	curl -i -L --user api:`cat ~/.transifex.key` \
		-F file=@lemonldap-ng-manager/site/htdocs/static/languages/en.json \
		-X PUT https://www.transifex.com/api/2/project/lemonldapng/resource/managerjson/content/
	echo

	echo "## portal mail.json"
	curl -i -L --user api:`cat ~/.transifex.key` \
		-F file=@lemonldap-ng-portal/site/templates/common/mail/en.json \
		-X PUT https://www.transifex.com/api/2/project/lemonldapng/resource/mailjson_1/content/
	echo

else
	echo "No ~/.transifex.key file found, exiting" >&2
	exit 1
fi
