Blame autobuild/transifex-push-template.sh

76d710
#!/bin/bash
cc4c9e
cc4c9e
set -e
cc4c9e
cc4c9e
SCRIPTPATH="${BASH_SOURCE[0]}";
cc4c9e
pushd `dirname "${SCRIPTPATH}"` > /dev/null
cc4c9e
SCRIPTPATH=`pwd`;
cc4c9e
popd  > /dev/null
cc4c9e
8a1dbe
8a1dbe
fix-pot()
8a1dbe
{
8a1dbe
	if [ -z "$1" ]; then
8a1dbe
		echo "ERROR: Please specify .pot file"
8a1dbe
		exit 1
8a1dbe
	fi
8a1dbe
8a1dbe
	PKGNAME="Package"
8a1dbe
	if [[ "$1" == "synfig.pot" ]]; then
8a1dbe
		PKGNAME="Synfig Core"
8a1dbe
	fi
8a1dbe
	if [[ "$1" == "synfigstudio.pot" ]]; then
8a1dbe
		PKGNAME="Synfig Studio"
8a1dbe
	fi
8a1dbe
8a1dbe
	YEAR=`date +%Y`
8a1dbe
8a1dbe
	sed -i "/# SOME DESCRIPTIVE TITLE/c\# Translation file for $PKGNAME package." "$1" || true
8a1dbe
	sed -i "/# Copyright (C) YEAR/c\# Copyright (C) $YEAR Synfig Contributors" "$1" || true
8a1dbe
	sed -i "/# This file is distributed under the same license as the PACKAGE package./c\# This file is distributed under the same license as the $PKGNAME package." "$1" || true
8a1dbe
}
8a1dbe
cc4c9e
cd "$SCRIPTPATH/../synfig-core/po"
76d710
rm synfig.pot || true
76d710
intltool-update --pot
8a1dbe
fix-pot synfig.pot
cc4c9e
cc4c9e
cd "$SCRIPTPATH/../synfig-studio/po"
cc4c9e
rm synfigstudio.pot || true
cc4c9e
intltool-update --pot
8a1dbe
fix-pot synfigstudio.pot
cc4c9e
cc4c9e
cd "$SCRIPTPATH/.."
cc4c9e
tx push -s