i18n-init.sh 490 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. PATTERN=$1
  3. SCM=
  4. [ -d .svn ] && SCM="svn"
  5. [ -d .git ] && SCM="git"
  6. [ -z "$SCM" ] && {
  7. echo "Unsupported SCM tool" >&2
  8. exit 1
  9. }
  10. [ -z "$PATTERN" ] && PATTERN="*.pot"
  11. for lang in $(cd po; echo ?? ??_??); do
  12. for file in $(cd po/templates; echo $PATTERN); do
  13. if [ -f po/templates/$file -a ! -f "po/$lang/${file%.pot}.po" ]; then
  14. msginit --no-translator -l "$lang" -i "po/templates/$file" -o "po/$lang/${file%.pot}.po"
  15. $SCM add "po/$lang/${file%.pot}.po"
  16. fi
  17. done
  18. done