transifex-push-template.sh 956 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. set -e
  3. SCRIPTPATH="${BASH_SOURCE[0]}";
  4. pushd `dirname "${SCRIPTPATH}"` > /dev/null
  5. SCRIPTPATH=`pwd`;
  6. popd > /dev/null
  7. fix-pot()
  8. {
  9. if [ -z "$1" ]; then
  10. echo "ERROR: Please specify .pot file"
  11. exit 1
  12. fi
  13. PKGNAME="Package"
  14. if [[ "$1" == "synfig.pot" ]]; then
  15. PKGNAME="Synfig Core"
  16. fi
  17. if [[ "$1" == "synfigstudio.pot" ]]; then
  18. PKGNAME="Synfig Studio"
  19. fi
  20. YEAR=`date +%Y`
  21. sed -i "/# SOME DESCRIPTIVE TITLE/c\# Translation file for $PKGNAME package." "$1" || true
  22. sed -i "/# Copyright (C) YEAR/c\# Copyright (C) $YEAR Synfig Contributors" "$1" || true
  23. 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
  24. }
  25. cd "$SCRIPTPATH/../synfig-core/po"
  26. fix-pot synfig.pot
  27. cd "$SCRIPTPATH/../synfig-studio/po"
  28. rm synfigstudio.pot || true
  29. intltool-update --pot
  30. fix-pot synfigstudio.pot
  31. cd "$SCRIPTPATH/.."
  32. tx push -s