txpull.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/sh
  2. #------------------------------------------------------
  3. # Script to pull language files to Transifex
  4. #
  5. # Laurent Destailleur - eldy@users.sourceforge.net
  6. #------------------------------------------------------
  7. # Usage: txpull.sh (all|xx_XX) [-r dolibarr.file] [-f]
  8. #------------------------------------------------------
  9. # Syntax
  10. if [ "x$1" = "x" ]
  11. then
  12. echo "This pull remote transifex files to local dir."
  13. echo "Note: If you pull a language file (not source), file will be skipped if local file is newer."
  14. echo " Using -f will overwrite local file (does not work with 'all')."
  15. echo "Usage: ./dev/translation/txpull.sh (all|xx_XX) [-r dolibarr.file] [-f] [-s]"
  16. exit
  17. fi
  18. if [ ! -d ".tx" ]
  19. then
  20. echo "Script must be ran from root directory of project with command ./dev/translation/txpull.sh"
  21. exit
  22. fi
  23. if [ "x$1" = "xall" ]
  24. then
  25. if [ "x$2" = "x" ]
  26. then
  27. echo "tx pull"
  28. tx pull
  29. else
  30. for dir in `find htdocs/langs/* -type d`
  31. do
  32. fic=`basename $dir`
  33. if [ $fic != "en_US" ]
  34. then
  35. echo "tx pull -l $fic $2 $3"
  36. tx pull -l $fic $2 $3
  37. fi
  38. done
  39. fi
  40. cd -
  41. else
  42. echo "tx pull -l $1 $2 $3 $4 $5"
  43. tx pull -l $1 $2 $3 $4 $5
  44. fi
  45. echo Think to launch also:
  46. echo "> dev/tools/fixaltlanguages.sh fix all"