Wesnoth localization tools
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.

update 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. # Update translations from subversion repository and merge them
  3. # Copyright (C) 2007-2008 Andrius Štikonas <stikonas@gmail.com>
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. source "`dirname $0`/variables"
  18. echo -e "Language: $RED$LCODE"$ENDCOLOR
  19. for BRANCH in $BRANCHES; do
  20. echo -e "Checking out files from $BLUE$BRANCH"$ENDCOLOR
  21. if [ ! -e "$BRANCH" ]; then
  22. mkdir "$BRANCH"
  23. fi
  24. $GIT archive --remote $REPO --prefix="$BRANCH-temp/" --format=tar "$BRANCH:po" | tar x
  25. for dir in `ls "$BRANCH-temp/wesnoth"* -d`; do
  26. echo "Processing `basename $dir | sed s/wesnoth-//`.$LCODE.po"
  27. file="$BRANCH/`basename $dir | sed s/wesnoth-//`.$LCODE.po"
  28. if [ -f $dir"/"$LCODE".po" ]; then
  29. if [ -f "$file" ]; then
  30. echo -e $BLUE"Merging:"$ENDCOLOR
  31. $MSGMERGE -U -v "$file" "$dir/`basename $dir`.pot"
  32. rm -f $file~
  33. else
  34. echo -e $RED"Copying:"$ENDCOLOR
  35. cp "$dir/$LCODE.po" "$file"
  36. fi
  37. else
  38. if [ ! -f $file ]; then
  39. echo -e $RED"No po file in repository. Running msginit."$ENDCOLOR
  40. echo "$dir"
  41. $MSGINIT -i "$dir/`basename $dir`.pot" -o $file
  42. else
  43. echo -e $RED"No po file in repository. Found file in workspace."$ENDCOLOR
  44. fi
  45. fi
  46. echo ""
  47. done
  48. rm -rf "$BRANCH-temp"
  49. done
  50. echo -e $GREEN"Finished."$ENDCOLOR