genstrings.sh 376 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. function getdir(){
  3. for element in `ls $1`
  4. do
  5. dir_or_file=$1"/"$element
  6. if [ -d $dir_or_file ]
  7. then
  8. getdir $dir_or_file
  9. else
  10. echo $dir_or_file
  11. suffix="${dir_or_file##*.}"
  12. if [ "$suffix"x = "swift"x ]||[ "$suffix"x = "m"x ]||[ "$suffix"x = "mm"x ];
  13. then
  14. genstrings -a -o zh-Hans.lproj $dir_or_file
  15. fi
  16. fi
  17. done
  18. }
  19. root_dir="./"
  20. getdir $root_dir