po2mo 661 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. #passed param: ex: de.po
  3. #but also handles name with actual name of application, ex: quicksetup.po
  4. [ ! $1 ] && exit
  5. xLANG="`echo -n $1 | cut -f 1 -d '.'`"
  6. if [ `echo -n $xLANG | wc --chars` -ne 2 ];then
  7. xAPP=$xLANG
  8. echo "passed filename: $1"
  9. echo -n "Enter 2-letter language (ex: de): "
  10. read xLANG
  11. [ `echo -n $xLANG | wc --chars` -ne 2 ] && exit
  12. else
  13. echo "passed filename: $1"
  14. echo "Enter name of application being translated: "
  15. read xAPP
  16. fi
  17. mkdir -p /usr/share/locale/${xLANG}/LC_MESSAGES
  18. msgfmt --check --output-file=/usr/share/locale/${xLANG}/LC_MESSAGES/${xAPP}.mo ${1}
  19. echo "Created /usr/share/locale/${xLANG}/LC_MESSAGES/${xAPP}.mo"