Translation helper scripts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

applysed 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. #
  3. # Copyright 2007, Donatas Glodenis <dgvirtual@akl.lt>
  4. # Copyright 2009, Andrius Štikonas <andrius@stikonas.eu>
  5. #
  6. # #
  7. # # This script is free software; you can redistribute it and/or modify
  8. # # it under the terms of the GNU General Public License 2 as published by
  9. # # the Free Software Foundation.
  10. #
  11. # # This script is distributed in the hope that it will be useful,
  12. # # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # # GNU General Public License for more details.
  15. # #
  16. # # You should have received a copy of the GNU General Public License
  17. # # along with this script; if not, write to the Free Software
  18. # # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. #
  20. # ths-applysed.sh - apply a sed script to the whole project (the sed commands
  21. # have to be supplied in an external file).
  22. source "`dirname $0`/ths-variables"
  23. function usage() {
  24. echo "Usage: `basename $0` <file-with-replacement-list> <base-directory>"
  25. echo
  26. echo "Example of the replacements file content:"
  27. echo "s/bylai/failui/g"
  28. echo "s/bylą/failą/g"
  29. echo "s/byloje/faile/g"
  30. exit 1
  31. }
  32. if [ $# -ne 2 ]; then
  33. usage
  34. fi
  35. for po in `find -L $2 -name "*.po"`; do
  36. echo -e $BLUE"$po"$ENDCOLOR
  37. sed --file=$1 -i $po
  38. done